Keep inventory command: how to turn on keep inventory in Minecraft
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
- 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.
- Go to the Console tab.
- Type
gamerule keep_inventory true. - 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 trueexecute in minecraft:the_end run gamerule keep_inventory true
Check or turn off keep inventory
gamerule keep_inventorywithout a value shows whether it istrueorfalse.gamerule keep_inventory falseturns it off again.
If it doesn’t work
- The server doesn’t accept the rule name. Use the other form:
keepInventorybefore 1.21.11,keep_inventoryfrom 1.21.11 on. - Players still lose items in the Nether or the End. Run the
execute incommands 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.