-
Notifications
You must be signed in to change notification settings - Fork 13
Mob Ragdolls
Mobs can be ragdolled too. The mob system is intentionally separate from the
player system internally: mobs use runtime-extracted model geometry and a
different hide/restore lifecycle. The public entry points still live on
RagdollAPI for convenience.
MobRagdollSession session = RagdollAPI.launchMob(level, mob, linearVelocity);
// With angular velocity and per-launch options:
RagdollAPI.launchMob(level, mob, linearVelocity, angularVelocity,
MobRagdollLaunchOptions.defaults());
RagdollAPI.isMobRagdolled(mob);
RagdollAPI.releaseMob(mob);Mob launches return a MobRagdollSession, not the player RagdollSession.
spawnMobless briefly creates a temporary entity of the requested type so the
client can extract its model, then discards that source entity once the ragdoll
has assembled. It returns the ragdoll UUID or null if the type cannot be
ragdolled. The call needs a player tracking the spawn position for the client
round-trip.
RagdollAPI.spawnMobless(level, entityType, position);
RagdollAPI.spawnMobless(level, entityType, position, linearVelocity, durationTicks);Mob ragdolls can be removed by ragdoll UUID or part sublevel UUID. dismemberMob detaches a part and returns sublevel UUID.
RagdollAPI.removeMobRagdoll(level, subLevelId);
RagdollAPI.removeMobRagdoll(level, subLevelId, smokePuff);
RagdollAPI.dismemberMob(level, partSubLevelId);