Craft-Animation 图标

Craft-Animation

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.0.0e
本资源为搬运资源,原资源地址: https://modrinth.com/mod/craft-animation
资源信息

Minecraft 版本: 26.1.2

平台: forge

标签: storage technology

资源介绍

Craft Animation

Craft Animation is a reusable animation library for Forge mod development.

This is not a content mod that directly adds weapons, mobs, or gameplay systems on its own. Instead, it provides a shared animation foundation that other mods can use to load, play, sample, and apply animations in a consistent way. The goal is to support players, mobs, generic entities, blocks, block entities, items, and display-based render objects through one common runtime structure.

Supported targets

  • Players
  • Mobs
  • Generic entities
  • Blocks
  • Block entities
  • Items
  • Display-based render objects

Included systems

  • Shared animation target types
  • Keyframe-based clip structures
  • Easing support
  • Controllers for play, stop, loop, and playback speed
  • Runtime tracking for active animation subjects
  • JSON-based animation loading
  • Example animation resources

Supported formats
Craft Animation is designed around two main input paths:

  • A generic built-in JSON clip format
  • Emotecraft-style emote JSON loading

That means you can either author your own clip format directly or reuse existing player animation data structures as part of your pipeline.

How to connect and use it in your mod
This library is meant to be connected to your own renderer, model, or gameplay code. It does not automatically inject finished animations into every vanilla render path by itself. The normal workflow looks like this:

1. Create an animation JSON file
Example location:

assets/yourmod/animations/guardian_idle.json

You can use the built-in example file as a reference:

assets/craftanimation/animations/example_idle.json

2. Load and register the clip
Use AnimationLibrary through CraftAnimationApi.library().

AnimationClip clip = CraftAnimationApi.library().loadBuiltin(
    "assets/yourmod/animations/guardian_idle.json",
    getClass().getClassLoader()
);

If the clip is already registered, you can fetch it later with:

AnimationClip clip = CraftAnimationApi.library().require("yourmod:guardian_idle");

3. Create an animation subject key
The runtime keeps separate animation state for each subject through AnimationSubjectKey.

Player example:

AnimationSubjectKey key = AnimationSubjectKey.player(
    level.dimension().location().toString(),
    player.getUUID()
);

Mob example:

AnimationSubjectKey key = AnimationSubjectKey.mob(
    level.dimension().location().toString(),
    mob.getUUID()
);

Block entity example:

AnimationSubjectKey key = AnimationSubjectKey.blockEntity(
    level.dimension().location().toString(),
    pos.getX(), pos.getY(), pos.getZ()
);

4. Start playback

CraftAnimationApi.runtime().play(key, clip);

You can also access the controller directly and change playback speed:

CraftAnimationApi.runtime().controller(key).setSpeed(1.25F);

5. Advance the animation every tick

CraftAnimationApi.runtime().tick(key, deltaTicks);

Or update every active controller at once:

CraftAnimationApi.runtime().tickAll(deltaTicks);

6. Sample the current pose

AnimationPose pose = CraftAnimationApi.runtime().sample(key);

The sampled AnimationPose is what you apply inside your own player renderer, entity model, block entity renderer, custom item renderer, or display rendering logic.

In short, the normal usage flow is:

  • Load a clip
  • Create a subject key
  • Play the clip
  • Tick the runtime
  • Sample the pose
  • Apply the pose in your render/model code

Typical use cases

  • Player idle stances while holding custom weapons
  • Mob idle, walk, or attack poses
  • Boss or scripted entity animation playback
  • Block entity machine or structure motion
  • Display-based cinematic timelines and visual effects

Notes

  • This mod is primarily a developer-facing library.
  • Installing it by itself will not add major gameplay content.
  • Final visual animation results still depend on how the consuming mod applies sampled poses to its renderer or model layer.
  • The runtime is shared, but the final implementation path is different for players, entities, blocks, and custom render systems.

Intended users

  • Forge mod developers
  • Projects that need a reusable data-driven animation system
  • Multi-version mod environments that want to keep one common animation architecture
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Multimine

价格:0 墨喵币
下载量:0

查看详情
More Lucky Charm Addon

价格:0 墨喵币
下载量:0

查看详情
Animal Garden - Bull Shark

价格:0 墨喵币
下载量:0

查看详情
Crouch-Jump

价格:0 墨喵币
下载量:0

查看详情