Class VanillaModels
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.vanilla.VanillaModels
Armatures on vanilla mobs and players, without replacing their models: play clips on their parts, change their
parts, wear armatures on them. Set up while the client sets up; works for any living entity drawn by a vanilla-style
renderer, including other mods' mobs.
// Emotes for players: clips named after the player's parts (head, body, right_arm, left_arm, right_leg, left_leg).
VanillaModels.player().animations(Armature.of("mymod", "emotes"));
VanillaModels.play(player, "emote", Motion.once("wave")); // here, on this client
ArmatureControl.play(serverPlayer, "emote", Motion.once("wave")); // from the server, seen by everyone
// Changes to the player's model.
VanillaModels.player().hide("hat").scale("head", 1.1F);
// A tail on every zombie, swinging on a spring.
VanillaModels.of(EntityType.ZOMBIE).attach("body", Armature.of("mymod", "tail"))
.offset(0, -10, 2)
.animate(animator -> animator.spring("tail"));
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Animatoranimator(net.minecraft.world.entity.Entity entity) The entity's animator, once it has been drawn.static @Nullable VanillaModelfind(net.minecraft.world.entity.EntityType<?> type) static booleanhasOverlap(@Nullable net.minecraft.world.entity.LivingEntity entity) Whether another mod is animating the entity right now, such as a Better Combat attack: a driver can hold an emote back while it does.static VanillaModelAsof(EntityType), for a type not registered yet (aRegistryEntry).static VanillaModelof(net.minecraft.world.entity.EntityType<?> type) One kind of mob; the same object every time.static List<AnimationOverlap> overlaps()static voidstatic voidPlays a clip from the mob'sVanillaModel.animationson its base layer.static VanillaModelplayer()Every player (yours and others'), in first person not at all: first-person arms stay vanilla.static voidregisterOverlap(AnimationOverlap overlap) Makes another mod that animates vanilla models known, so clips share parts with it (seeVanillaModel.overlapRule(OverlapRule)).static voidBlends a layer back to vanilla's own animation.
-
Method Details
-
player
Every player (yours and others'), in first person not at all: first-person arms stay vanilla. -
of
One kind of mob; the same object every time. -
of
Asof(EntityType), for a type not registered yet (aRegistryEntry). -
play
Plays a clip from the mob'sVanillaModel.animationson its base layer. -
play
-
stop
Blends a layer back to vanilla's own animation. -
animator
The entity's animator, once it has been drawn. -
registerOverlap
Makes another mod that animates vanilla models known, so clips share parts with it (seeVanillaModel.overlapRule(OverlapRule)). The player animation mod Better Combat uses is known already. -
hasOverlap
public static boolean hasOverlap(@Nullable @Nullable net.minecraft.world.entity.LivingEntity entity) Whether another mod is animating the entity right now, such as a Better Combat attack: a driver can hold an emote back while it does.layer.drive(ctx -> VanillaModels.hasOverlap(ctx.living()) ? null : IDLE_POSE); -
overlaps
-
find
@Internal @Nullable public static @Nullable VanillaModel find(net.minecraft.world.entity.EntityType<?> type)
-