Corpse

From the Fear Nightfall wiki · Corpse
Corpse
Mobs1

Corpse is a death-handling mod by Max Henkel that is included in Fear Nightfall. On death, the player's inventory is stored in a corpse entity at the place of death instead of being scattered as item drops. The mod adds no items, blocks, mobs, structures, biomes, recipes or loot; its effect is entirely on what happens to a player's gear when they die, which matters in a pack where deaths during horror encounters are frequent.

Overview

The mod adds one entity, the Corpse, and a per-player death history. Every death while the mod is loaded replaces the normal drops with a corpse that holds the stored items, so the player can recover them by returning to the spot. The corpse keeps everything the player carried, including armour, the offhand slot and any items that do not fit in the main inventory. For the general death and respawn rules of the pack, see Death and Respawning.

Content

The mod adds no items, mobs, structures, biomes, recipes, loot tables, advancements, sounds or enchantments. Its content is:

  • Corpse (corpse:corpse), a miscellaneous entity 2 × 0.5 blocks in size. It is never hostile and never spawns naturally. It is created only by a player's death, or temporarily by the death history screen when a stored death is viewed. Its display name is "Corpse of" followed by the dead player's name. It renders as the dead player's model wearing the player's skin, and turns into a skeleton after one hour.
  • Corpse inventory screen, with 41 slots (4 armour, 1 offhand, 36 main inventory) and two buttons, "Transfer Items" and "Additional Items".
  • Additional items screen, a paginated overflow screen of 54 slots per page, used for items that do not fit in the corpse's main layout.
  • Player Death History screen, listing past deaths with their date, dimension and location, and an "Items" button for each death.
  • Death history key, bound to U by default in the Misc category. Fear Nightfall rebinds it to O to avoid a key clash (see Controls and Keybinds).
  • /deathhistory <player|uuid>, an operator command (permission level 2) that opens another player's death history.

The mod also adds two optional integrations. With Jade installed, the corpse's tooltip shows the dead player's name, the death date and the number of item stacks. With OpenHud installed, the death history screen gains an "Add Waypoint" button that marks the death position with a skull icon.

Mechanics

Death capture. When a player dies, the corpse stores the main inventory, armour, offhand and any overflow items. The corpse is placed at the death position, with its vertical position limited to the world's minimum build height. The stored items are then removed from the normal drops.

Opening and transferring. Right-clicking a corpse opens its inventory. If the main inventory is empty but overflow items remain, the additional items screen opens directly. "Transfer Items" returns each stack to the matching vanilla slot: main inventory items to the main slots, armour to the armour slots, and the offhand item to the offhand slot. If that slot is already occupied, the existing stack is moved into any free space in the player's inventory. Anything that does not fit is left in the corpse's overflow list. Transfers are checked on the server, and are refused if the player is dead or the corpse can no longer be edited.

Emptying and despawning. A corpse is empty when its main, armour, offhand and overflow lists are all empty. An empty corpse is removed after 600 ticks (30 seconds) by default. A corpse that still holds items is never removed by the default timer. The force-despawn timer is disabled by default, so a corpse with items remains until it is emptied, or destroyed by lava (if enabled). Whenever a corpse is removed, every item it still holds is dropped on the ground as item stacks.

Skeleton stage. After 72,000 ticks (one hour) the corpse's model changes to a skeleton. This is cosmetic only, and the stored inventory is unchanged.

Physics. The corpse has gravity and horizontal drag, and floats in water and lava. It does not burn in fire. By default it cannot fall out of the world: a corpse that goes below the minimum build height is moved back to that height, so it rests at the bottom of the world. Lava removes the corpse only when the lava_damage option is enabled, which is off by default.

Equipment display. The corpse shows a snapshot of the armour, main hand and offhand equipment taken at the time of death. This is enabled by default through the show_equipment option.

Death history. Each stored death keeps a timestamp, the dimension, the block position, the item lists and the equipment. The death history key (O in this pack, U by default) or /deathhistory opens the list, which is navigated with Previous and Next buttons. The "Location" area copies a /execute in <dimension> run tp @s <x> <y> <z> command into the chat box for the player to run; it does not teleport the player. The "Items" button opens the stored death's items. Only creative-mode players can take items from a historical death. Other players see those items as read-only.

Storage duration. Stored deaths are kept for death_storage_duration days. The default of -1 keeps them forever. A value of 0 disables death storage and the history command.

Access. By default any player can open any corpse. When the only_owner option is enabled, only the owner can open it. Operators can always open a corpse. Corpses with no owner recorded can be opened by anyone.

Changes to vanilla

  • Death drops are replaced. While the mod is loaded, the normal drops of every death are removed and the stored items go into the corpse. The corpse holds those items instead.
  • Corpses block building. A corpse occupies space, so blocks cannot be placed inside it.
  • Removal spills items. Removing a corpse always drops its remaining items on the ground.
  • New command and key. The /deathhistory operator command and the death history key (default U, rebound to O in this pack) are added.
  • No other changes. The mod changes no vanilla items, blocks, recipes, loot tables, tags, biomes, structures, trades or mob spawns. It does not change hunger, experience, combat, sleeping or respawning.

In Fear Nightfall

The pack runs the mod with its default settings. The values in use are:

  • death_storage_duration = -1, so every death is kept in the history indefinitely.
  • only_owner = false, so any player can open any corpse.
  • despawn.time = 600 ticks and despawn.force_time = -1, so empty corpses disappear after 30 seconds and corpses with items never despawn on a timer.
  • skeleton_time = 72000 ticks.
  • show_equipment = true, fall_into_void = false, lava_damage = false and lie_on_face = false.

Because any player can open any corpse by default, looting another player's corpse is possible in a multiplayer world, and the corpse is not protected unless the owner-only setting is enabled.

Hordes. The Hordes cancels the death drops that the corpse needs, so a zombie player's inventory would otherwise be lost. The pack sets zombiePlayersStoreItems to false. The corpse then keeps every item and the zombie player still spawns. For the zombie players themselves, see Player Zombies.

Curios, Accessories and backpacks. The pack tested the corpse with Accessories and Curios and Traveler's Backpack and found it works without changes. The mod's own code handles only the vanilla inventory slots, so this result comes from the pack test rather than from the mod's code.