Class VanillaModel
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.vanilla.VanillaModel
What CoolCatLib adds to one kind of vanilla mob (or the player) without replacing its model: clips played on its
parts, changes to its parts, and armatures worn on them. Get it from
VanillaModels; every call adds to it, so
several mods can add to the same mob. Set it up while the client sets up.
VanillaModels.player()
.animations(Armature.of("mymod", "emotes")) // clips by part name: head, right_arm, left_leg...
.hide("hat")
.pose((pose, ctx) -> { if (ctx.living().isCrouching()) pose.scale("head", 1.2F); });
VanillaModels.of(EntityType.ZOMBIE).attach("head", Armature.of("mymod", "party_hat")).offset(0, 8, 0);
-
Method Summary
Modifier and TypeMethodDescriptionSets up each entity's animator (layers, drivers, listeners) when it is first drawn.@Nullable Armatureanimations(Armature armature) Where its clips come from: an armature (a Blockbench model, or a Bedrock.animation.jsonalone) whose joints are named after the vanilla parts.Wears an armature on a part; set it up through what this returns.firstPersonArms(boolean show) For the player: shows your own arms in first person posed as the clips pose them (an emote waves the arm you see), with what you hold, in place of vanilla's first-person hands, while anything plays on the animator.firstPersonArms(Predicate<Animator> when) AsfirstPersonArms(boolean), shown only while this holds (asked every frame).Hides parts (and what hangs from them) for good.mirrorLeftHanded(boolean mirror) Mirrors its clips for left-handed entities (a left-handed player's swing comes from the left arm): left and right parts swap, and turns and moves flip sideways.booleanoverlapRule(OverlapRule rule) What its clips do on parts another mod is moving (overlapping parts, such as Better Combat's attack swings):OverlapRule.YIELDby default.pose(VanillaPose.Modifier modifier) Changes its parts every time it is drawn, after vanilla and the clips.Turns a part further for good, in degrees.Scales a part for good.setups()booleanshowsFirstPersonArms(Animator animator) booleantest(net.minecraft.world.entity.LivingEntity entity) Reads its clips' joints with torso joint names, common in player emote files:torsois the body part, andbodymoves the whole model.Moves a part for good, in pixels.booleanApplies everything here only to entities that pass, asked every frame (a cosmetic some players own, a mob with a tag).
-
Method Details
-
animations
Where its clips come from: an armature (a Blockbench model, or a Bedrock.animation.jsonalone) whose joints are named after the vanilla parts. Clips played on it (VanillaModels.play,ArmatureControl.play, a layer's driver) move the parts of the same names, on top of vanilla's animation: a part a playing clip moves is taken over from vanilla, the rest walk and look around as usual. -
animate
Sets up each entity's animator (layers, drivers, listeners) when it is first drawn. -
pose
Changes its parts every time it is drawn, after vanilla and the clips. -
hide
Hides parts (and what hangs from them) for good. -
scale
Scales a part for good. -
rotate
Turns a part further for good, in degrees. -
translate
Moves a part for good, in pixels. -
attach
Wears an armature on a part; set it up through what this returns. -
when
Applies everything here only to entities that pass, asked every frame (a cosmetic some players own, a mob with a tag). With several filters, all must pass. -
overlapRule
What its clips do on parts another mod is moving (overlapping parts, such as Better Combat's attack swings):OverlapRule.YIELDby default. -
mirrorLeftHanded
Mirrors its clips for left-handed entities (a left-handed player's swing comes from the left arm): left and right parts swap, and turns and moves flip sideways. Off by default. -
torsoJointNames
Reads its clips' joints with torso joint names, common in player emote files:torsois the body part, andbodymoves the whole model. Without this,bodyis the body part and onlyrootmoves the whole model. -
firstPersonArms
For the player: shows your own arms in first person posed as the clips pose them (an emote waves the arm you see), with what you hold, in place of vanilla's first-person hands, while anything plays on the animator. The arms are drawn in the hand pass, so they never clip into walls, and bend, follow other mods' swings and wear their sleeves as in third person. -
firstPersonArms
AsfirstPersonArms(boolean), shown only while this holds (asked every frame). -
showsFirstPersonArms
-
mirrorsLeftHanded
@Internal public boolean mirrorsLeftHanded() -
usesTorsoJointNames
@Internal public boolean usesTorsoJointNames() -
overlapRule
-
animations
-
setups
-
modifiers
-
attachments
-
test
@Internal public boolean test(net.minecraft.world.entity.LivingEntity entity)
-