Class ArmatureItems
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.render.ArmatureItems
Items drawn with an armature. The model comes from the item's model file in a resource pack,
assets/<namespace>/items/<item>.json:
{
"model": {
"type": "minecraft:special",
"base": "mymod:item/wand",
"model": { "type": "coolcatlib:armature", "armature": "mymod:wand", "animation": "idle" }
}
}
base is an ordinary item model, for its display transforms (how it sits in a hand, a slot, a frame) and its
particle texture. animation is a clip looped for every stack; texture swaps the first texture.
For more, register a setup: each stack gets its own animator, whose context has the stack.
ArmatureItems.register(MyItems.WAND, animator -> animator.layer("base")
.drive(ctx -> ctx.stack().has(MyComponents.CHARGED) ? GLOW : IDLE));
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAsregister(Item, Consumer), for an item that isn't registered yet.static voidSets up the animator of every stack of an item.setup(net.minecraft.world.item.Item item)
-
Method Details
-
register
-
register
public static void register(Supplier<? extends net.minecraft.world.item.Item> item, Consumer<Animator> setup) Asregister(Item, Consumer), for an item that isn't registered yet. -
setup
-