Here are some cool block-hit animations inspired by the provided OneSevenAnimation code, each with unique transformations and effects. These animations can be implemented in Minecraft mods or resource packs to add flair to the block-hitting experience:
1. Spiral Strike Animation
object SpiralStrikeAnimation : AnimationChoice("SpiralStrike") {
private val rotateSpeed by float("RotateSpeed", 1.5f, 0.5f..3.0f)
private val swingScale by float("SwingScale", 0.8f, 0.1f..1.0f)
override fun transform(matrices: MatrixStack, arm: Arm, equipProgress: Float, swingProgress: Float) {
val time = (System.currentTimeMillis() % 3600L) / 1000f
val spiralOffset = (time * rotateSpeed).toFloat() % 360f
matrices.translate(if (arm == Arm.RIGHT) -0.1f else 0.1f, 0.1f, 0.0f)
applySwingOffset(matrices, arm, swingProgress * swingScale)
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-90f + spiralOffset))
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(spiralOffset * 0.5f))
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(spiralOffset))
}
}
Effect: The tool spirals around its axis while swinging, creating a dynamic and hypnotic effect.
2. Hammer Smash Animation
object HammerSmashAnimation : AnimationChoice("HammerSmash") {
private val smashScale by float("SmashScale", 0.3f, 0.1f..0.5f)
private val swingScale by float("SwingScale", 1.2f, 0.5f..1.5f)
override fun transform(matrices: MatrixStack, arm: Arm, equipProgress: Float, swingProgress: Float) {
val smashProgress = swingProgress * smashScale
matrices.translate(0.0f, -smashProgress * 0.5f, 0.0f)
applySwingOffset(matrices, arm, swingProgress * swingScale)
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-120f + (smashProgress * 60f)))
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(if (arm == Arm.RIGHT) 45f else -45f))
}
}
Effect: The tool smashes downward with a heavy impact, mimicking a hammer strike.
3. Lightning Slash Animation
object LightningSlashAnimation : AnimationChoice("LightningSlash") {
private val speed by float("Speed", 2.0f, 1.0f..3.0f)
private val swingScale by float("SwingScale", 1.0f, 0.5f..1.5f)
override fun transform(matrices: MatrixStack, arm: Arm, equipProgress: Float, swingProgress: Float) {
val time = (System.currentTimeMillis() % 1000L) / 1000f
val lightningOffset = (time * speed).toFloat() % 360f
matrices.translate(if (arm == Arm.RIGHT) -0.2f else 0.2f, 0.1f, 0.0f)
applySwingOffset(matrices, arm, swingProgress * swingScale)
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-45f + (swingProgress * 90f)))
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(lightningOffset * 2f))
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(if (arm == Arm.RIGHT) 30f else -30f))
}
}
Effect: The tool moves in a quick, lightning-like slash with rapid rotations, giving a fast and sharp appearance.
4. Boomerang Spin Animation
object BoomerangSpinAnimation : AnimationChoice("BoomerangSpin") {
private val spinSpeed by float("SpinSpeed", 3.0f, 1.0f..5.0f)
private val swingScale by float("SwingScale", 0.7f, 0.1f..1.0f)
override fun transform(matrices: MatrixStack, arm: Arm, equipProgress: Float, swingProgress: Float) {
val time = (System.currentTimeMillis() % 3600L) / 1000f
val spinOffset = (time * spinSpeed).toFloat() % 360f
matrices.translate(if (arm == Arm.RIGHT) -0.1f else 0.1f, 0.0f, 0.0f)
applySwingOffset(matrices, arm, swingProgress * swingScale)
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-60f))
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(spinOffset))
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(if (arm == Arm.RIGHT) 20f else -20f))
}
}
Effect: The tool spins like a boomerang while swinging, creating a circular motion.
5. Earthquake Slam Animation
object EarthquakeSlamAnimation : AnimationChoice("EarthquakeSlam") {
private val slamScale by float("SlamScale", 0.4f, 0.1f..0.6f)
private val swingScale by float("SwingScale", 1.0f, 0.5f..1.5f)
override fun transform(matrices: MatrixStack, arm: Arm, equipProgress: Float, swingProgress: Float) {
val slamProgress = swingProgress * slamScale
matrices.translate(0.0f, -slamProgress * 0.8f, 0.0f)
applySwingOffset(matrices, arm, swingProgress * swingScale)
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-135f + (slamProgress * 45f)))
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(if (arm == Arm.RIGHT) 10f else -10f))
}
}
Effect: The tool slams downward with force, mimicking an earthquake-like impact.
These animations can be customized further by adjusting the parameters (e.g., rotation angles, translation values, and speeds) to fit different tools or gameplay styles. Enjoy experimenting!