MCA: Corpses: Corpses, Rendering & Decay
On this page (8)
This guide explains which entities produce MCA villager corpses, how their appearance is rendered on the client, and how decay and despawn timers work.
Which deaths spawn an MCA corpse
MCA: Corpses classifies eligible deaths into seven VillagerKind categories, each controlled by a toggle in mcacorpses-server.toml:
| Kind | Source entity | Hostile by default? | Server config toggle |
|---|---|---|---|
Living MCA Villager |
mca:male_villager, mca:female_villager |
No (unless mca:outlaw profession or isHostile()) |
enableVillagerCorpses |
MCA Zombie Villager |
mca:male_zombie_villager, mca:female_zombie_villager |
Yes |
enableZombieVillagerCorpses |
Bridged Guard |
Guard Villagers actor via MCA: Mob Compatibility |
No (unless hostile standing / outlaw) |
enableBridgedGuards |
Bridged Recruit |
Villager Recruits actor via MCA: Mob Compatibility |
No (unless hostile standing / outlaw) |
enableBridgedRecruits |
Bridged Worker |
Villager Workers actor via MCA: Mob Compatibility |
No (unless hostile standing / outlaw) |
enableBridgedWorkers |
Bridged Trader |
Wandering Trader actor via MCA: Mob Compatibility |
No (unless hostile standing / outlaw) |
enableBridgedTraders |
Bridged Pillager |
Pillager actor via MCA: Mob Compatibility |
Yes |
enableBridgedPillagers |
Empty corpses and conversions
- Empty deaths (
spawnEmptyCorpses = true): By default, a corpse still spawns even if the villager died carrying zero items and zero owned equipment—useful if you want a visible body to mourn or revive with a Staff of Life. SetspawnEmptyCorpses = falseto skip spawning corpses when the final captured inventory layout is empty. - Zombie conversions: If an entity triggers
LivingConversionEvent.Post(such as a villager converting into a zombie villager rather than dying permanently), MCA: Corpses cancels any pending corpse for that death so no ghost corpse is left behind. - Hidden MobCompat proxies:
MCA: Mob Compatibilityuses hidden proxy villager entities (mcamobcompat_proxyscoreboard tag ormcamobcompat:guarddata) behind visible guards, recruits, workers, traders, and pillagers. Those hidden proxies never spawn a standalone corpse; only the visible actor’s death triggers a unified corpse using the proxy’s MCA appearance and canonical UUID. - No duplicate Recruits corpses: When Villager Recruits is installed alongside MCA: Mob Compatibility,
RecruitsCorpseHooksuppresses Recruits’ ownRecruitCorpseSpawner#spawnCorpsefor bridged recruits so only one unified MCA corpse spawns.
Player death history stays clean
Because McaCorpseSpawner creates Corpse’s CorpseEntity directly without calling Corpse’s DeathManager.addDeath(...), villager deaths never clutter your personal death history or Corpse’s /deaths / death-menu log.
Exact villager appearance rendering
On the client, an optional Mixin hook (CorpseRendererHook targeting de.maxhenkel.corpse.entities.CorpseRenderer#render) checks whether a CorpseEntity is an MCA villager corpse.
How the detached model works
- When a corpse spawns or enters a player’s tracking range, the server sends a
CorpseAppearancePacketcontaining the sanitized visual NBT (SnapshotNbt),villagerEntityType,villagerName, and optionalroleOutfit. SnapshotSanitizer.sanitizeForClientRenderstrips heavy server-only data (Brain,Offers,Inventory,ArmorItems,HandItems,ActiveEffects,UUID,Attributes,HomePos, and MobCompat proxy tags) while preserving visual traits such as MCA genetics, skin, hair, eyes, age, clothes, and Townstead visual data.ClientCorpseRegistrycreates a detached, untickedLivingEntityview with AI disabled, death/hurt timers zeroed, and custom name hidden so it renders purely as a still body.McaCorpseClientRendererfreezes walk/head/body animations and lies the villager flat at the corpse’s yaw:- Face-up (default): Rotated
-90°on X when Corpse’slie_on_face(spawnOnFace) isfalse. - Face-down: Rotated
+90°on X when Corpse’slie_on_face(spawnOnFace) istrue.
- Face-up (default): Rotated
Role outfits, equipment layers, and caching
- Role outfits (
renderRoleOutfits = true): For bridged NPCs fromMCA: Mob Compatibility, their resolved role outfit (CharacterRole.outfit) is applied onto the detached MCA model. TurningrenderRoleOutfitsoff inmcacorpses-client.tomlrenders their underlying MCA clothing instead. - Equipment rendering (
renderCorpseEquipment = true): Equipped armor, main-hand, and offhand items stored on the corpse are drawn on the lying villager model as long as bothrenderCorpseEquipment(mcacorpses-client.toml) and Corpse’sshow_equipment(corpse-server.toml) aretrue. - Live visual sync (
syncLootedEquipmentVisuals = true): Taking an armor piece, weapon, or shield out of the corpse GUI immediately updates the corpse’sequipmentlist so the item disappears from the rendered body in real time. Placing an eligible item into slot 0 of main inventory, the offhand slot, or the four armor slots updates the visual equipment back onto the corpse. - Memory & fallback safety:
ClientCorpseRegistryuses an LRU cache capped at256entries with a600-tick (30-second) idle expiration, cleared on dimension unload or disconnect. If a specific entity type fails to render (e.g., an incompatible third-party render layer),FAILED_TYPESsafely falls back to Corpse’s default player-corpse renderer for1200client ticks (60seconds) before retrying.
Decay and despawn lifecycle
Each MCA villager corpse tracks its own age (McaAge) and empty age (McaEmptyAge) inside mcacorpses:data. Three server config timers in mcacorpses-server.toml control how they age:
villagerSkeletonTime(default-1)villagerEmptyDespawnTime(default-1)villagerForceDespawnTime(default-1)
Each override uses the same three-mode convention:
| Value | Meaning | Behavior |
|---|---|---|
-1 |
Inherit Corpse config (default) |
Uses Corpse’s corpse-server.toml settings (skeleton_time, despawn.time, despawn.force_time). When all three are -1, MCA: Corpses defers ticking entirely to Corpse mod natively. |
0 |
Never |
Disables that timer permanently for MCA villager corpses (e.g., villagerSkeletonTime = 0 keeps full villager skin forever; 0 on despawn prevents removal). |
> 0 |
Custom tick count |
Uses that exact number of game ticks ( 20 ticks = 1 second) for MCA villager corpses without changing player corpses. |
For reference, Corpse mod’s own default corpse-server.toml values (tested on 1.20.1-1.0.23) are:
corpse.skeleton_time = 72000(3,600 seconds / 60 minutes)corpse.despawn.time = 600(30 seconds after becoming empty)corpse.despawn.force_time = -1(never force-despawn non-empty corpses)
What happens at the skeleton stage
- Once
McaAge >= effectiveSkeletonTime(wheneffectiveSkeletonTime > 0), the corpse’sisSkeletonflag becomestrue. McaCorpseClientRendererintentionally skips custom MCA rendering whenCorpseBinding.isSkeleton(corpse)istrue, letting Corpse mod render the decayed skeleton model (still wearing any remaining equipment if enabled).- If
villagerForceDespawnTime > 0andMcaAge > villagerForceDespawnTime, the corpse is discarded even if it still holds items. - Otherwise, once all items are removed (or immediately if spawned empty),
McaEmptyAgestarts counting from the first empty tick; whenMcaAge - McaEmptyAge >= effectiveEmptyDespawnTime(and> 0), the empty corpse despawns. - By default (
allowRevivingSkeletonCorpses = true), even a skeletonized villager corpse can still be revived with a Staff of Life unless you disable that option inmcacorpses-server.toml.