Content generated with AI — it may contain mistakes.

Visuals

Ragdolls

A player's body cut into its parts and choreographed: thrown apart, danced, imported from Blockbench or Emotecraft.

A body that comes apart, or moves like one. The player is cut into its six parts (head, torso, two arms, two legs), each wearing its own skin, and those parts move as one piece of choreography. The choreography can be thrown apart, opened out, spelled into letters or carried off, or it can be danced frame by frame.

effects:
  # Thrown apart. The pieces leave outwards, fall, bounce and rest.
  - '[RAGDOLL] {victim};intact:0.3;life:2.6;speed:4.2;up:6.4;spin:2.2;detail:2;light:15'
  # Lifted, opened out, and taken upwards. Nothing is left on the floor.
  - '[RAGDOLL] {victim};pose:vortex;rise:3.0;open:0.7;turns:1.8;life:3.0;detail:2;glow:{highlight}'
  # A wave imported from Blockbench, with a body's lag and breath.
  - '[RAGDOLL] {victim};anim:wave;follow:1;breathe:1;rig:tophat'

Ragdolls need PacketEvents, like every display.

Who it wears

HeadBody
{victim}The victim, or the killer when there is no victim. The default.
{killer}The killer, or the victim when there is no killer.
{crowd}A spectator who is neither; seat: picks which one (0, 1, 2…).

If no player can be worn, the line says so once and draws nothing. A plugin can hand the line a body of its own with SequenceTarget.wearing(model).

The poses

PoseWhat happensAlso written
burstThrown apart: the pieces leave outwards, fall, bounce and rest. The default.
spreadLifted off the ground and opened out, arms and legs wide, turning slowly, then let go.starfish, open
knockedHeld open like spread, then struck several times from different sides.knock, batted, hit
vortexTaken: the pieces spiral inwards and upwards and are gone at the top.taken, ascend, spiral
balloonThe head swells far too big, wobbles, and bursts.bighead, big_head, swell, pop
helicopterThe arms go flat above the head as a rotor, the body counter-turns, and it leaves forwards.chopper, rotor
planeArms out as wings, nose up, banking as it climbs. A negative climb is a dive.fly, glide, jet
flattenDriven straight down and left flat: a player-shaped stain.pancake, squash, flat
meltSinks where it stands and is gone. No throw, no bounce.sink, dissolve
signThe pieces lay themselves out into letters and hold there, then fall.letters, spell, word
thrownSent somewhere in one piece, turning end over end. With no gravity it never comes back.launched, ejected, carried, spaced
animatePlays the frames in keys: or an imported anim:. Chosen by itself when either is written.animated, dance, choreography, keys

An unknown pose plays burst.

Its parameters

ParameterWhat it doesDefault
pose:Which of the twelve above.burst
life:Seconds the pieces last.2.2; see below
intact:Seconds the body stands whole before anything happens to it.0.3
detail:How finely the body is cut, 1 to 5.1
size:How big it is; 1 is player-sized.1
light:Light level, 0 to 15.the world's own
glow:Outline colour: a name, #rrggbb or a {palette} token.none
fade:Shrinks away at the end instead of vanishing.true
settle:Stops turning once it lands.true
y:Height above the anchor.0
face:Turns to face whoever set the sequence off.true
speed: up:How fast the pieces leave, outwards and upwards.3.2 / 6.5
spread:How much the pieces differ from each other, 0 to 1.0.45
gravity: bounce:Blocks per second squared, and the speed kept on landing.26 / 0.32
spin:Turns a second.1.8
rise: open:How far off the ground a held body hangs, and how far its limbs open out.1.1 / 0.55
lift: hang: turns:Seconds the lift takes, seconds it hangs, and turns it makes while it hangs.0.45 / 0.9 / 0.35
hits: every: force:For knocked: how many blows, seconds between them, how far one shoves it.3 / 0.32 / 0.85
swell:For balloon: how many times its own size the head reaches.3
squash:For flatten: what is left of a piece's height.0.14
sign: letters:For sign: what the body spells, and how tall one letter is in blocks.EZ / 2.4
dir:Which way it is thrown or flies, in degrees. 0 is east, 90 is south.away from the killer
hold: offhand: hat:Items in the right hand, the left hand and on the head.none
hold_size: hat_size: hat_y:Their sizes, and how high the hat sits.0.7 / 0.6 / 0
rig:Props from rigs.yml, comma-separated.none
strings:Puppet strings from both hands and the head up to this height.0
chains:Chains from the wrists to the floor, this far out to each side.0
snip:Seconds until the strings or chains break.the last frame

life: written always wins. Without it, a looping body lasts five minutes as a safety net, and a choreographed one lasts its intact time, its frames and its finish.

What detail costs

The head is always one piece; the other parts are cut into columns and rows from their size. Detail 1 is six displays, 2 is nineteen, 3 is fifty-six and 4 is seventy-three. 5 is a shell: one block per part with the skin's design laid over every face as plates, up to 120 displays. A body that spells is cut at 4 at most. Two reads as a body at any distance somebody actually watches one from.

Choreography: keys:

keys: is a dance written frame by frame, frames split by |. Each frame starts with the seconds it takes to reach it, then a pose word or channels:

effects:
  - '[RAGDOLL] {victim};keys:0.25 crouch ease=anticipate | 0.35 stand up=1.6 flip=~-360 elbows=60 ease=out | 0.3 up=0 plant=1 knees=40 ease=bounce | 0.3 stand;then:dissolve;follow:1'
ChannelWhat it moves
at=r,u,f, right= up= forward=The hips, right, up and forward.
flip= turn= lean=The whole body about the hips.
head= body= arm_r= arm_l= leg_r= leg_l= arms= legs=A joint, as pitch,yaw,roll.
<joint>_at=out,up,fwdPulls a part off its joint.
size=, <joint>_size=Size of the body or one part.
elbow_r= elbow_l= elbows= knee_r= knee_l= knees= spine=Bends a joint, as angle,direction.
plant=0..1Keeps the feet on the floor wherever the hips go.
shake=Shakes it.
ease=in_out (default), in, out, linear, back, anticipate, elastic, bounce, snap, smooth.

~ makes a value relative: flip=~-360 is one more backflip. The pose words are stand, tpose, star, cheer, reach, zombie, hug, crouch, sit, kneel, lie, prone, bow, pray, dab, superman, splits, float, limp, fetal, swoon, heart and arabesque; a pose word resets every bend. A turn faster than 160° a tick is warned about at load.

Bending, planting and breathing

  • Bends. An elbow bends the forearm forward, a knee the shin back, the spine the chest forward. A direction of 90 bends outwards; -90 on an elbow bends it across the body. A body that bends is cut into at least two rows per limb, even at detail 1.
  • Planted feet. At plant=1 the legs are solved to reach the floor, so a body that sinks bends its knees. The feet stay where they were when plant last rose from zero.
  • Breathing. breathe: (0 to 3) lays a slow breath over every frame: the spine, the shoulders and the head, one breath every 3.4 seconds, fitted so a loop holds a whole number of them.
  • Follow-through. follow: (0 to 3) makes loose joints lag and overshoot: 0 is exact, 1 a body, 2 a cartoon.

The finish: then:

What happens after the last frame: hold (the default), burst, collapse, implode, dissolve or spell.

Loops and wind-ups

KeyWhat it does
loop:Repeats the frames. Warned about when the last frame does not match the first; a whole turn counts as matching.
loop_from:Seconds of entry played once before the loop.
accel: max_speed:Each cycle that many times faster, up to the cap: a wind-up.
tempo:Playback speed, or a range 1-1.6 rolled once per play so a crowd does not dance in step.

A camera that goes round with a looping body is its own [CAMERA] line in the sequence.

Importing Blockbench and Emotecraft animations

plugins/<YourPlugin>/animations/wave.json

Put the file in the animations folder of the plugin whose sequence plays it. Files are read on first use and again whenever the folder changes; there is nothing to reload.

FormatWhat is read
Blockbench (Bedrock or GeckoLib export)Bones head, torso, body (the whole body), right_arm, left_arm, right_leg, left_leg, and <part>_bend bones for bends. Rotation, position and scale, with their curves. "loop": true loops.
Emotecraftmoves by tick, with its begin, end and stop ticks, and its loop point.

A single-animation file is named by its file name (wave.json → wave). An Emotecraft file also answers to its name, and each animation in a Blockbench file to its full key (animation.player.wave) or its last part (wave). Names ignore case. A file that loops sets loop and loop_from for you.

Props: rigs.yml

plugins/ExyliaLib/rigs.yml holds things made of blocks that a body wears, holds or carries. It is the server's file, not a plugin's, so every [RAGDOLL] line on the server can use every prop: rig:tophat, rig:crown,wand. It ships with tophat, crown, wand and cake.

plugins/ExyliaLib/rigs.yml
rigs:
  halo:
    joint: head
    at: 0, 0.25, 0
    blocks:
      - 'ring GOLD_BLOCK r:0.30 n:18 y:0 s:0.08'
FieldWhat it is
jointhead, face, chest, hips, hand_r, hand_l, foot_r, foot_l.
atOffset of the whole prop from the joint.
blocksat MATERIAL x: y: z: s: one block; ring MATERIAL r: n: y: s: a circle; disc MATERIAL r: y: s: a filled one.

Numbers are in the joint's own axes: y runs along the limb and z is the way the body faces. A prop is solved with the body, so it stays in the hand through a cartwheel. 256 blocks at most per prop.

Real skins: ragdoll-skin-quality

A ragdoll wears the player's real skin with nothing to set up: no key, no account. The head is the player's real head item, so the face is exact from the first frame. The rest of the body is cut into pieces, and each piece is made into a texture by Exylia Skins, a free service with a cache shared by every server. A piece any server already made arrives at once; a new one is drawn in blocks of the nearest colour until it arrives. The only setting is how finely the body is cut, in plugins/ExyliaLib/config.yml:

plugins/ExyliaLib/config.yml
ragdoll-skin-quality: normal
QualityPieces per skinWhat it looks like
high184-pixel cubes; a breaking body comes apart in 19 pieces.
normal (default)10Every skin pixel kept exactly; each part an upper and a lower box, 11 pieces.
low5One head per part; a third of the rows lost.

Once any of its pieces has arrived, a body in its real skin is cut by this quality and ignores detail:.

  • Made once, for everybody. A piece is named by the hash of its pixels and uploaded once, ever. A piece that is one block's colour all over is drawn as that block and never uploaded. Each plugin that shows bodies keeps the pieces it got in its own database (table exylia_ragdoll_skins), so a restart asks for nothing.
  • Prepared on join. A skin is prepared when its owner joins. A skin changed mid-session (such as SkinsRestorer's /skin) is prepared again the next time it is read.
  • Offline mode. A player with no skin wears the default skin the game gives their UUID (Steve, Alex and the other default skins, wide or slim).
  • Never a wait. A piece whose texture has not arrived yet is drawn in blocks until it does.
  • Applied live. /exylialib reload reads the quality, and a change prepares the skins of everybody online again.
Upgrading from a MineSkin key

Older versions needed a mineskin-key. It is no longer read: the next start removes it from config.yml, as it does with any key the file no longer has.

The API

PluginRagdolls ragdolls = Ragdolls.of(this);
 
RagdollAnimation hop = RagdollAnimation.parse(
        "0.25 crouch ease=anticipate | 0.35 stand up=1.6 flip=~-360 | 0.3 up=0 plant=1 knees=40 ease=bounce",
        problem -> getLogger().warning(problem));
 
RagdollMotion dance = RagdollMotion.builder()
        .pose(RagdollPose.ANIMATE)
        .animation(hop)
        .finish(RagdollFinish.DISSOLVE)
        .follow(1).breathe(1)
        .tempo(1.0, 1.3)
        .build();
 
RagdollProp crown = Rigs.get("crown");
RagdollModel body = RagdollModel.of(victim).detail(2).light(15)
        .rigs(crown == null ? List.of() : List.of(crown));
 
RagdollHandle handle = ragdolls.show(body, dance, victim.getLocation(), viewers);
TypeWhat it gives
RagdollModelof(player), ofTexture(base64), ofAccount(name) (a future that falls back to the default skin), of(RagdollSkin.flat(colours), head) for a body that is not a player. Then detail, scale, glow, light, carrying(main, off, hat), rigs.
RagdollMotion.builder()Every line key as a method: pose, animation, finish, loop, loopFrom, winding, tempo, follow, breathe, strings, chains, life, speed, gravity…
RagdollAnimationsfind(pluginName, name) for an imported file; read(json, file, problems) to read one without a server.
RagdollHandleremove(), settle(millis) to stand it back up and go, isShowing(), pieces().
Rigsget(id), ids().

ragdolls.show solves the whole flight before it returns. Nothing is simulated and nothing is ticked: every pose is worked out in advance and handed to the client.

Something missing on this page? Tell us on Discord