Skip to content

Keepinv

Lyof429 edited this page Jul 20, 2026 · 1 revision

< Back to homepage

Better KeepInventory

Sortilege provides several narrower alternatives to Minecraft's all-or-nothing keepInventory gamerule.

A world can retain equipped items, protect particular item types, or use the Soulbound enchantment while allowing the rest of a player's inventory to drop normally.

Keeping equipped items

When keep_equipped is enabled, the player keeps:

  • All 9 hotbar slots.
  • Worn armor.
  • The offhand slot.

Items in the rest of the main inventory continue to drop normally.

{
  "death": {
    "keep_equipped": true
  }
}

This creates a middle ground between losing everything and enabling the full keepInventory gamerule.

Soulbound items

Items enchanted with Soulbound are retained after death regardless of their inventory slot.

Soulbound applies to most unstackable equipment and utility items. It cannot normally be placed on:

  • Stackable items.
  • Food.
  • Buckets.
  • Block items.
  • Items in #sortilege:soulbind_blacklist.

Applying Soulbound

Soulbound may be obtained as an enchantment or applied through a Smithing Table.

Smithing slot Ingredient
Template Lapis Lazuli
Base An eligible item
Addition Echo Shard

The addition slot accepts items in:

#sortilege:is_soulbind_material

Echo Shards are included by default.

Consuming Soulbound

The configuration contains:

{
  "death": {
    "consume_soulbound": false
  }
}

This option is intended to remove Soulbound after it saves an item.

Items kept by tag

Any item in the following item tag is retained after death:

#sortilege:kept_on_death

The default tag contains:

minecraft:recovery_compass

Datapacks may add important quest items, tools, maps, keys, or other objects that should never be dropped by death.

Example:

{
  "replace": false,
  "values": [
    "examplemod:quest_key",
    "examplemod:spellbook"
  ]
}

Save this as:

data/sortilege/tags/items/kept_on_death.json

Use "replace": true to replace the default contents instead of adding to them.

Curse of Storytelling

The Curse of Storytelling prevents its enchanted item from being intentionally dropped from the selected slot.

This includes using the normal drop key and related selected-item removal behavior.

AUTHOR NOTE: The current code does not include Curse of Storytelling in the same explicit death-retention check used by Soulbound and #sortilege:kept_on_death. Until all death paths are tested, use Soulbound as well when the item must unquestionably survive death.

Death coordinates

Sortilege can replace the score shown on the death screen with the player's death coordinates.

{
  "death": {
    "show_coordinates_on_death": true
  }
}

This helps players return to dropped items without granting complete inventory protection.

Complete configuration

{
  "death": {
    "keep_equipped": false,
    "consume_soulbound": false,
    "show_coordinates_on_death": true
  }
}
Field Description
keep_equipped Retains the hotbar, armor, and offhand after death.
consume_soulbound Intended to remove Soulbound after it prevents an item from dropping.
show_coordinates_on_death Displays death coordinates on the death screen.

These systems operate independently of XP Keeping.

Clone this wiki locally