Animations and skills
These keys make a model blend its animations and make any cosmetic cast MythicMobs skills. Blockbench settings says how to set each animation of a model. The end of the page lists what BoxCosmetics adds to your own MythicMobs skills.
animation
How many ticks each animation of a model show blends in and out over. It works like ModelEngine's lerp in and out, and 20 ticks are 1 second. Default: 0,0, so each animation switches at once.
# cosmetics/back.yml
dragon-wings:
item: FEATHER
show: meg:dragon_wings
slot: wear
animation:
idle: 10,10 # in over 10 ticks, out over 10
walk: 5 # 5 in, 5 out
glide: 0,10 # starts at once, out over 10
- Animations not listed here switch at once, with no blending. Name each animation as the model names it. As shipped, those are the names in States and moments;
model.animationscan point a state at another animation. - A line with no number switches at once, as
0,0does. On a cosmetic whoseshowis not a model,animationis warned about and not used. - A model put on by
/bc head,/bc wearor/bc balloonwith a cosmetic's name blends as that cosmetic's lines say. Withmeg:<model>, it does not blend.
Blockbench settings
Set each animation's Loop Mode and Override in Blockbench (right-click the animation), then import the model into ModelEngine again.
| Animation | Loop Mode | Override |
|---|---|---|
idle, walk, sprint |
Loop | Off |
jump, fall, fly, glide, climb, float |
Loop | On |
sneak, crawl, swim, sit, sleep, riptide |
Loop | On |
burn, freeze |
Loop | Off |
jump_start, jump_end, spawn, respawn, swing, use |
Play Once | On |
hurt |
Play Once | Off |
death |
Hold On Last Frame | On |
- Every animation plays on its own layer, on top of
idleorwalk. - Override On: the bones this animation moves follow only this animation while it plays. Bones it does not move keep the animations under it.
- Override Off: this animation's movement is added to the animations under it, as a shake or a flinch needs.
- Give an animation keyframes only on the bones it should move.
- An animation for something that lasts (every row down to
burnandfreeze) set to Play Once plays once as that thing starts, then stops until it starts again. - A moment (
jump_starttohurt) set to Loop or Hold On Last Frame never ends until the cosmetic comes off. deathholds its last frame until the cosmetic is removed, 1 second after the death.- Blockbench makes a new animation Play Once with Override off, so an
idleorwalkleft that way plays once and stops.
Skills
Under skills, the cosmetic casts MythicMobs skills, so MythicMobs must be installed. Write each one as mm:<skill> or mythic:<skill>: the name of a metaskill. In the skill, @Self is the wearer. A line without mm: or mythic: is warned about and not cast.
On, off and while worn
spawn casts once as the cosmetic goes on, and take-off casts once as it comes off. worn casts as it goes on, then again every so many ticks.
# cosmetics/hats.yml
fire-hat:
item: LEATHER_HELMET
slot: head
skills:
spawn: mm:FireHatOn # once, as it goes on
worn: mm:FireHatAura, 5 # as it goes on, then every 5 ticks
take-off: mm:FireHatOff # once, as it comes off
- Use
take-offto clean up what the other skills started.wornwith no number, or0, casts once. - It goes on when it is put on, when the player joins or respawns wearing it, and when the player becomes visible. The view button does not make it go on or off.
- It comes off when it is taken off, when the permission is lost, when the player dies or leaves, when the server stops, and when the cosmetic is deleted and then
/bc reloadruns. - It also comes off when the player becomes invisible, goes into spectator, or is marked
vanishedby a vanish plugin. - While a player is in the showcase, nothing the player puts on or takes off casts a skill until the player leaves it.
States and moments
A state's skill is cast as the state starts, and repeats every so many ticks when a number follows it. A moment's skill is cast once.
# cosmetics/hats.yml
fire-hat:
item: LEATHER_HELMET
slot: head
skills:
sneak: mm:SneakPuff # once, as sneaking starts
walk: mm:WalkDust, 5 # as walking starts, then every 5 ticks
jump_start: mm:FireHop # once, at each jump
- Only one state of each group is on at a time. States of different groups can be on together.
- A name that is in neither table below is warned about and never cast.
| Group | States |
|---|---|
| Moving | idle, walk, sprint |
| Flying | fly (creative), glide (elytra) |
| Jumping | jump, fall (falling with no jump before it) |
| Crawling | crawl, swim |
| Each in its own group | climb, float (in water, not swimming), sneak, riptide, sit (riding), sleep, burn, freeze |
| None | worn |
If they have no line of their own, sprint casts walk's skill, glide casts fly's, fall casts jump's and swim casts crawl's.
| Moment | When |
|---|---|
spawn, take-off |
It goes on, comes off |
respawn |
It goes on within 2 seconds of a respawn, instead of spawn. Without a respawn line, spawn casts |
jump_start, jump_end |
The wearer jumps, lands |
swing |
Left-click swing: hit, dig or miss |
use |
Right-click swing: place, use or throw |
hurt, death |
The wearer is hurt, dies |
In your MythicMobs skills
BoxCosmetics adds a targeter, a mechanic and a condition to MythicMobs, for the cosmetics a caster wears.
| Name | Kind | What it does |
|---|---|---|
@bcpart (@bcmodelpart) |
Targeter | Like @modelpart, for a bone of a worn model |
bcanimation (bcanim, bcstate) |
Mechanic | Like state{}, for a worn model |
bcwearing (bcwears) |
Condition | Whether the entity wears a cosmetic |
@bcpartreads the caster's cosmetics.bcanimationandbcwearingread the cosmetics of the entity they act on: with@self, the caster's. Each works on a player or a stand.@bcpartandbcanimationneed ModelEngine.- After updating BoxCosmetics, run
/mm reloador restart.
# plugins/MythicMobs/Skills/cosmetics.yml
JetpackThrust:
Skills:
- particle{p=soul_fire_flame;a=2} @bcpart{p=group5;slot=wear;offset=GLOBAL;y=-0.15}
- bcanimation{a=jump_start;li=2;lo=4} @self
- particle{p=dust;color=#FF2BD6;a=24} @self ?bcwearing{c=neon-knight-helmet-headwear}
@bcpart takes @modelpart's attributes (by default offset is LOCAL, and exactmatch and scale are true), plus:
| Attribute | Takes |
|---|---|
slot |
head, wear, balloon. On a stand also mannequin. Any other word targets nothing |
view (copy) |
own or self (the copy on the wearer's own screen, drawn a little ahead), others or shown (the copy other players see), auto (default). Any other word works as auto |
lead |
How many ticks ahead to place it, so particles do not trail behind. The default is set by the player's ping. 0: none. It works only where the place comes from the wearer's own copy |
- With no
slotormodelid, it targets every matching bone, hidden ones too. autousesotherswhile someone else sees the wearer. A stand's model is drawn only once.
To show it on every screen, cast it twice:
# plugins/MythicMobs/Skills/cosmetics.yml
FlameOnEveryScreen:
Skills:
- particle{p=soul_fire_flame;a=8;hs=0.14;audience=self} @bcpart{p=group_emissive7;view=own}
- particle{p=soul_fire_flame;a=8;hs=0.14;audience=nonSelf} @bcpart{p=group_emissive7;view=others}
bcanimation plays an animation over the cosmetic's own animations, as the model's file sets that animation. The wearer sees it too.
| Attribute | Takes |
|---|---|
animation (anim, a, state, s) |
The animation's name, as the model has it. Without it, nothing plays |
lerpin (li), lerpout (lo) |
Ticks, 0 and 1 by default. Below 0 counts as 0 |
speed (sp), remove (r) |
speed: its speed, 1 by default. remove: true stops it, false (default) plays it |
force (f) |
true (default) restarts it if playing |
slot, model (m, mid) |
Pick which models it plays on: slot takes the words of @bcpart's slot, and model a model's id. With neither, it plays on every worn model that has the animation |
bcwearing takes cosmetic (c, key, k): cosmetic keys, in any case, separated by commas. It is true if any of them is worn, anywhere. With no key, it is false.