Json实体动画 (Json Entity Animation)
Json实体动画(JsonEA)是一个库模组,用于通过JSON定义动画,而不是通过代码。为了将您的动画导出到此格式,还提供了一个 【Blockbench插件】(animation_to_jsonea.js)(也可在Blockbench插件浏览器中找到)。
开发者指南
要将该模组添加为依赖项,请使用 [Modrinth Maven](
gradle
dependencies {
include(modImplementation("maven.modrinth:json-entity-animation:0.2.1+1.19.4"))
}
添加后,将您的动画JSON放在 `assets/modid/jsonea` 目录下。要加载动画,您的实体模型必须是 `SinglePartEntityModel`/`HierarchicalModel` 的子类。然后定义一个 `JsonAnimator` 字段和动画ID。
java
public class MyEntityModel extends SinglePartEntityModel
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);
}
}
Json Entity Animation 0.2.1 for 1.19.4-1.20.1
Json Entity Animation 0.2 for 1.19.2
Also a breaking change because animations are in the "jsonea" directory now, instead of "animations".
Json Entity Animation 0.1 for 1.19.2
收录