Keep inventory command: how to turn on keep inventory in Minecraft

Last updated

The keep inventory command is /gamerule keep_inventory true. Run it in your server’s Console tab, or in chat as an operator, and players keep their items and experience when they die. On Minecraft 1.21.10 and older the rule is called keepInventory.

The command for your version

  • Minecraft 1.21.11 and newer, including 26.x: gamerule keep_inventory true
  • Minecraft 1.21.10 and older: gamerule keepInventory true

Minecraft 1.21.11 renamed every game rule to lowercase words with underscores. To see or change your server’s version, see how to update your server.

Turn on keep inventory from the Console

  1. Open your server in the dashboard. It has to be running: if it says Sleeping, click Wake up, then Start. If it says Stopped, click Start.
  2. Go to the Console tab.
  3. Type gamerule keep_inventory true.
  4. Press Enter or click Run.

The console confirms the new value. It works straight away, without a restart, and stays on because the world saves it. You can type commands with or without the leading /: the Console drops it.

Bedrock players on your server keep their items too: the rule belongs to the server, not to the player’s edition.

Turn it on in game

In game, /gamerule only works for operators. If you aren’t one yet, run op and your own name in the Console tab first, for example op Steve. See how to op someone.

Then type /gamerule keep_inventory true in chat.

The Nether and the End on Paper and Spigot

On Paper and Spigot, the Nether and the End can each keep their own game rules. If players still lose their items there, also run these in the Console:

  • execute in minecraft:the_nether run gamerule keep_inventory true
  • execute in minecraft:the_end run gamerule keep_inventory true

Check or turn off keep inventory

  • gamerule keep_inventory without a value shows whether it is true or false.
  • gamerule keep_inventory false turns it off again.

If it doesn’t work

  • The server doesn’t accept the rule name. Use the other form: keepInventory before 1.21.11, keep_inventory from 1.21.11 on.
  • Players still lose items in the Nether or the End. Run the execute in commands above.
  • A plugin handles deaths. Grave, PvP and minigame plugins can change what a player drops on death. Check that plugin’s settings.

Still stuck? Ask on Discord

The Minefort team and community are there. Tell us what you tried and someone will point you the right way.

Join the Discord