Download Json Entity Animation — Minecraft Mods — MetaMods

Json Entity Animation

Active

Downloads

0

Last update

2 years ago

Versions

1.19.2 — 1.20.1
Client
Fabric
Quilt
Libraries

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);
    }
}
Project members
Gaming32

Gaming32

Admin

Created: 1 Apr 2023

ID: 11884