How to Turn On Keep Inventory on a Minecraft Server
Losing a full inventory to lava is the fastest way to make a friend quit your server. Keep inventory fixes that with one command, but recent Minecraft versions renamed the rule and Paper servers have a catch that trips up almost everyone.
/gamerule keep_inventory true in the console or in game as an operator. On older versions the rule is spelled keepInventory. On Paper, Spigot or Purpur, also run it in the Nether and End: /execute in minecraft:the_nether run gamerule keep_inventory true and the same with minecraft:the_end.Turn it on
You need operator permission. If you are not opped yet, see how to OP yourself.
From the in-game chat:
/gamerule keep_inventory true
From your server console, leave out the slash:
gamerule keep_inventory true
The server replies with something like Gamerule keep_inventory is now set to: true. That's it, no restart needed. Game rules are saved with the world.
To check the current value, run the rule with no value:
/gamerule keep_inventory
"Incorrect argument" or "Unknown game rule"?
Recent Minecraft versions renamed every game rule to lowercase with underscores. So:
| Your version | Command |
|---|---|
| Recent versions (including 26.x) | /gamerule keep_inventory true |
| Older versions | /gamerule keepInventory true |
If you are not sure which version you are on, type /gamerule (with the space) and press Tab. The game lists the exact spelling your server accepts.
The Paper catch: Nether and End
On a vanilla server, game rules apply to every dimension. On Paper, Spigot and Purpur (most plugin servers), the Nether and the End are separate worlds, and each one keeps its own game rules. So keep inventory works in the Overworld, then someone dies in the Nether and loses everything.
Set it in all three:
/gamerule keep_inventory true
/execute in minecraft:the_nether run gamerule keep_inventory true
/execute in minecraft:the_end run gamerule keep_inventory true
If you use a world manager plugin with extra worlds, set it in those too.
What keep inventory does and doesn't do
- Keeps: everything in your inventory, armor, offhand, and your XP levels.
- Doesn't keep: items in an open chest or furnace, items you dropped before dying, or your spawn point.
- Curse of Vanishing items still disappear on death, even with keep inventory on.
Want something in between?
Some groups think keep inventory makes survival too easy. A few middle-ground options:
- Grave plugins (for example AngelChest or GravesX) put your items in a chest where you died, so you have to go back for them.
- Keep inventory only in the Nether, using the per-world trick above in reverse.
- Turn it on for the first week while everyone gets set up, then turn it off.
Related
FAQ
Why does keep inventory work in the Overworld but not in the Nether?
On Paper, Spigot and Purpur the Nether and the End are separate worlds with their own game rules. Set the rule in each one, for example /execute in minecraft:the_nether run gamerule keep_inventory true.
Do players keep their XP with keep inventory on?
Yes. With keep inventory on, players keep both their items and their experience levels when they die.
Do I need to restart the server after changing it?
No. Game rules apply the moment you run the command and are saved with the world, so they survive restarts.
Want a server that just runs fast?
FreaksMC runs on NVMe hardware with performance-tuned defaults baked in - pre-optimized Paper, sane view distances, and one-click world pre-generation. Set up in 60 seconds.
See plans from $3/mo