
Json Entity Animation
Json Entity Animation (abbreviated as JsonEA) is a library mod that enables other modifications to define animations through JSON files instead of writing program code. For convenience, a Blockbench plugin is also provided, available through the built-in extension store of this program, which allows exporting created animations to a compatible format.
For Developers
Add the mod as a dependency using the Modrinth Maven repository.
dependencies {
include(modImplementation("maven.modrinth:json-entity-animation:0.2.1+1.19.4"))
}
After adding the dependency, place your JSON animation files in the assets/modid/jsonea
directory. To load the animations, your entity model must inherit from SinglePartEntityModel
or HierarchicalModel
. Then define a JsonAnimator
field and animation identifiers.
public class MyEntityModel extends SinglePartEntityModel<MyEntity> {
private static final Identifier PUNCH_ANIMATION = new Identifier("modid", "my_entity/punch");
private final JsonAnimator animator = new JsonAnimator(this);
// ...
@Override
public void setAngles(MyEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
getPart().traverse().forEach(ModelPart::resetTransform);
animator.animate(entity.punchState, PUNCH_ANIMATION, animationProgress);
}
}