Repository navigation
Making Animations for a player
varun-liver edited this page Oct 17, 2026
·
5 revisions
To make an animation, first create an animation JSON file or import a .glb or .gltf file, preferably from Blockbench's Bedrock Entity mode. For this page, let's assume I made an animation called wave. Every player animation has 7 bones:
- right_leg
- left_leg
- body
- right_arm
- left_arm
- head
- camera
Note: only 3rd-person animations currently work.
The JSON file should be at
src/main/resources/assets/<modid>/animationlib/animations/The code for this would be,
{
"animations": {
"wave": {
"animation_length": 2,
"loop":false,
"force_third_person": true,
"relative":true,
"bones": {
"right_arm": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [-180, 0, 0],
"1.0": [0, 0, 0]
}
},
"camera": {
"rotation": {
"0.0": [180, 0, 0],
"1.0": [180, 0, 0]
},
"position": {
"0.0": [0, 0, -5],
"1.0": [0, 0, -5]
}
}
}
}
}
}
"animation_length" measures the animation's length in seconds. "force_third_person" decides if the client forces third person on the player. "relative" determines if the camera bone's position is relative to the player or not. "cameraFollowsPlayer" decides what bone the camera follows. "hideInventory" hides the inventory and hotbar. Always use lowercase IDs.
To play the Animation, you can run /animation <modid>:<your animation> thirdperson
Or by running it in code:
import com.animationlib.api.Animation;
public final class MyAnimations {
public static final Animation <animation> = Animation.init("yourmodid:animationame")
.forceThirdPerson(true); // optional, same as the JSON flag
.cameraFollowsPlayer("right_arm"); // Also optional, replace right_arm with something else
}
// when you want it to play (server or client):
MyAnimations.<animation>.play(player);
MyAnimations.<animation>.stop(player);
MyAnimations.<animation>.isPlaying(player);
isPlaying returns a Bool value.