Json Entity Animation

模组

· 作者 TakiSpl

用于在 JSON 中创建实体动画的库模组

0 本站下载 0 关注 更新于 3 年前

最新 0.2.1+1.19.4 · 1.20.1 · Fabric / Quilt

一键开服(送7天)

Json Entity Animation

Json Entity Animation(简称 JsonEA)是一个库模组,供其他模组通过 JSON 而非代码来定义动画使用。我们还提供了一个 Blockbench 插件(也可在 Blockbench 插件浏览器中找到),用于将你的动画导出为该格式。

给开发者

使用 Modrinth Maven 将该模组作为依赖项添加。

dependencies {
    include(modImplementation("maven.modrinth:json-entity-animation:0.2.1+1.19.4"))
}

添加后,请将你的动画 JSON 文件放入 assets/modid/jsonea 目录中。要加载这些动画,你的实体模型必须继承自 SinglePartEntityModel/HierarchicalModel。然后定义一个 JsonAnimator 字段以及动画 ID。

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);
    }
}

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源