Wiki 9Minecraft Wiki 9Minecraft
Kasugalib Wiki › Guides › Create an Animated Model Using KasugaLib's JSON System

Create an Animated Model Using KasugaLib's JSON System

Understanding JSON-Based Animation

KasugaLib provides a registry system for custom animated models using JSON configuration. This allows you to define keyframe animations without writing complex rendering code.

Steps

1. Create a JSON file in your mod's assets folder defining your model structure and animation keyframes

2. Specify model parts, their pivot points, and rotation/position changes across animation frames

3. Register your model JSON using KasugaLib's model animation registry, providing the file path and a unique model identifier

4. Reference your registered model in your block entity or entity renderer using the identifier

5. Trigger animations through your mod's logic by calling the animation playback method with the model identifier and desired animation state

6. Test animation timing and smoothness in-game, adjusting keyframe values as needed

KasugaLib handles interpolation between keyframes and rendering pipeline integration automatically. This system works well for block entity animations (like rotating machinery) and custom entity animations. Combine with blockstate JSON for state-dependent animation triggering.