Skip to main content

Enable Minecraft keep inventory with the right version-specific gamerule

Enable keep inventory when your community wants players to retain carried items after death. Agree on the rule with players first, particularly on an economy or competitive server. Changing this rule affects future deaths; it does not return items lost before the change.

Find the server's edition and version

Use the version shown during server startup, rather than the version of your own Minecraft client. A compatibility plugin can let a different client version connect without changing the server's gamerule syntax. Geyser users joining a Java server also follow the Java server's rules.

For a Java server, open Console in the game panel. You need permission to send console commands. Enter examples without a slash there; operators entering them in in-game chat add a slash. Keep a completed backup as described in our game backup guide, and record the current value before changing it.

Use the matching command

Mojang changed Java gamerule identifiers in 1.21.11 from camel case to namespaced snake case. On Java 1.21.11 and the 26.x releases using that syntax, query the value first:

gamerule minecraft:keep_inventory

Record the response, then enable it:

gamerule minecraft:keep_inventory true

On Java 1.21.10 and earlier, use the older spelling instead:

gamerule keepInventory
gamerule keepInventory true

For a native Bedrock dedicated server, consult the Bedrock gamerule reference and use keepinventory. Do not change your Java rule to the Bedrock spelling merely because some players connect through Geyser.

Check the intended world

Run the query again after the change and wait for the confirmation. In a setup with several worlds or dimensions, check behaviour in each place where you expect it to apply. Multiworld and inventory plugins can maintain separate settings or change death handling. Use an operator standing in the intended world, or your world plugin's documented controls, when the console's default world is not the one you mean.

Use a separate test server or a consenting test account with expendable items. Put valuable gear away. Check the hotbar, carried items, armour and experience before and after a controlled death. Also inspect any grave, death-chest or inventory-recovery plugin: retaining the items and creating a recovery chest could produce an unintended duplicate if two systems conflict. Keep the test small and stop if you see unexpected copies.

Resolve an unknown-rule error

Copy the exact startup version and command reply. Confirm capitals and underscores against the examples above. An error from an old tutorial is a reason to check the version, not a reason to reinstall. Use command suggestions in-game where available. If a plugin intercepts commands, consult its documentation rather than granting every player operator access.

To reverse the setting, repeat your version's command with false, or restore the previous value you recorded. Test again with expendable items. Changing the rule back does not reverse deaths, inventory edits or plugin-generated duplicates that happened during testing. If you also plan a version upgrade, follow our Minecraft version-change guide and review the rule again afterward.