Skip to content

Addon Examples

Leo-T22 edited this page Jun 27, 2026 · 1 revision

Addon Examples

Keybind Example

RagdollKeybindExample in the source is a worked end-to-end example showing an on-foot pose and an elytra pose built with the public API.

Removing A Clicked Ragdoll

RagdollAPI.remove(level, clickedSubLevelId, true);

Passing an attached part UUID removes the whole ragdoll. Passing a severed limb UUID removes only that loose limb.

Dismembering A Clicked Player Ragdoll Part

UUID limbId = RagdollAPI.dismember(level, clickedPartSubLevelId);
if (limbId != null) {
   // The limb is now an independent free body.
}

Dismembering A Clicked Mob Ragdoll Part

UUID limbId = RagdollAPI.dismemberMob(level, clickedPartSubLevelId);
if (limbId != null) {
   // The limb is now an independent free body.
}

Playerless Corpse With Equipment

RagdollEquipmentSnapshot snapshot =
   RagdollAPI.captureEquipment(player, RagdollEquipmentScope.ALL);

PlayerlessRagdollSession corpse =
   RagdollAPI.detachActive(player, PlayerlessDespawnRule.never());

if (corpse != null) {
   RagdollAPI.applyEquipmentSnapshot(level, corpse.id(), snapshot);
}

Clone this wiki locally