Skip to content

Animation in Minecraft

KosmX edited this page Jun 14, 2022 · 2 revisions

How is an animation integrated into Minecraft

First, we need to look at an interesting property: alpha value
This shows how transparent our animation is.
0 means the animation is disabled, and 1 means anything behind our animation is disabled.

While the animation is happening, we want to completely overwrite Minecraft's built-in animation engine, but just before our animation ends, we want to go back to the default pose.

Key points in time:

  • Let t=0 be when the animation starts.
  • Begin: The animation starts at this time.
  • End: The animation ends.
  • Stop: The player is in the default position, modifying the player's pose is no longer needed.

By default, the alpha value looks like this (0:start, 5:begin, 35:end, 40:stop):
image

Until the end time, the player will move to the default position if the animation does not explicitly state the position.
Normally the animation frames are between the begin and the end.

More control?!

You can put keyframes after the end or before the begin. If you do, for the used property the end or the begin will shift to your keyframe, making your keyframe to be the real first or last keyframe of the animation.

It is advised to set the end to the last keyframe in your animation.

Why this?

Without setting the default pose between the beginning and the end, an animation not defining every property could behave unexpectedly.