Skip to content

How to Turn On Keep Inventory in Minecraft (Java, Bedrock and Servers)

The keep inventory command for Java and Bedrock, turning it on in singleplayer, Realms and on a server console, what it keeps, and the Paper Nether catch.

Updated November 28, 2026
Minecraft

To turn on keep inventory in Minecraft, run /gamerule keep_inventory true on Java Edition or /gamerule keepinventory true on Bedrock Edition. From then on, every player in that world keeps their items and their experience when they die. The change is instant, needs no restart, and survives restarts because game rules are saved inside the world itself.

That one line is the whole answer if commands already work where you are playing. Usually the real question is why they don't: commands are off in this singleplayer world, you're on a Realm, the command says "Incorrect argument for command", or you're on a server and nobody has told you where the console is. This guide covers each of those, what keep inventory does and doesn't keep, and the server-side catch where the rule is on in the Overworld but you still lose everything in the Nether.

Versions and date checked

Checked against minecraft.wiki on 28 November 2026, for the current releases: Java Edition 26.3 and Bedrock Edition 26.66. The Java rule name changed in 1.21.11, and both spellings are given below.

The Command for Each Edition

Where Command Notes
Java 1.21.11 and later (including 26.x) /gamerule keep_inventory true Snake case. This is the current name
Java 1.21.10 and earlier /gamerule keepInventory true The old camelCase name. Current versions reject it
Bedrock Edition /gamerule keepinventory true All lowercase. Needs cheats on in that world
A server console (Java) gamerule keep_inventory true No slash in the console

To turn it back off, run the same command with false. To check the current value, leave the value off: /gamerule keep_inventory prints whether it is true or false, which is the quickest way to confirm a change really took.

"Incorrect argument for command" usually means the wrong spelling for your version

Java Edition 1.21.11 moved every game rule into a registry and renamed them from camelCase to snake_case, so keepInventory became keep_inventory. Most videos and older guides still show the old name. Bedrock never had either spelling and uses keepinventory. The full list of renames, including the ones that were not straight case changes, is in Minecraft Server Commands.

Java Singleplayer: When Commands Are Off

/gamerule is a cheat command, so it only works if commands are allowed in that world. You have three routes, depending on how the world was created.

  1. You enabled Allow Commands when you made the world. Type the command in chat. Nothing else is needed.
  2. You didn't, and you're on 26.2 or later. Press Esc and open World Options. Since Java Edition 26.2, the host of a world can use the Allow Commands button there, in the world you're already in. Turn it on and the command works.
  3. You'd rather not type commands. Java has an Edit Game Rules screen with a toggle for every rule, keep inventory included. It's on the Create New World screen, where it doesn't need commands. Since 26.1 it's also in World Options in the pause menu, but there the button only works while Allow Commands is on.

Hardcore worlds have no switch for this

In a Hardcore world, World Options greys out Edit Game Rules, and Allow Commands too if you started without commands. There's no switch for either afterwards.

Older guides tell you to Open to LAN to get commands for yourself. That stopped working in 26.2, when the LAN screen's Allow Commands button became a setting for the other players that no longer affects the host. How to Teleport in Minecraft covers that change in more detail.

Bedrock Worlds and Realms

On Bedrock, keep inventory is a toggle in the world settings, in the Cheats section of the world menu, next to the other cheats-only game rules. You can also type /gamerule keepinventory true once cheats are on.

The catch is achievements. Turning cheats on in a Bedrock world permanently stops anyone from earning achievements in that world, even if you turn cheats off again later. If achievements matter to you, decide before you flip the switch, or make the change in a copy of the world.

Realms. On a Java Realm the owner is an operator, so the owner can run /gamerule keep_inventory true in chat like on any server. On a Bedrock Realm, the owner or an operator edits the world settings, and most of them can be changed from the game menu while you're playing on the Realm. Keep inventory sits in the same Cheats section, with the same achievements cost.

On a Server: The Console Route

On a multiplayer server the command needs permission level 2 if you type it in chat. Level 2 also hands out /gamemode and /give, so don't op friends just so they can run it. Minecraft Op Permission Levels explains what each level gives.

The console doesn't have that problem. It always runs at full permission. On a GameServerKings Minecraft server, open the Console tab in the panel and type:

gamerule keep_inventory true
Console (Java server)

No slash, no restart, and nothing to edit in server.properties. There isn't a keep-inventory key in that file, so adding one does nothing. The server reads the file, ignores the unknown line, and the game rule stays as it was. Game rules belong to the world save, which is why the setting survives restarts and why it comes with the world if you move it to another server.

Bedrock Dedicated Server. The server ships with allow-cheats=false, which blocks cheat commands typed in chat, even by an operator. The console isn't affected: we ran this on a Bedrock Dedicated Server 1.26.66.1 with the default allow-cheats=false and the rule changed. Run it in the Console:

gamerule keepinventory true
Console (Bedrock server)

Set allow-cheats=true only if you want operators to use commands in game. Bedrock server.properties has the details.

The Nether and End catch on Paper servers

On vanilla Java, one game rule covers the Overworld, the Nether and the End. Paper treats the three dimensions as separate worlds, each with its own set of game rules. A gamerule typed in the console only changes the main world. The usual symptom is a report that keep inventory "works in the Overworld but I lost everything in the Nether".

Don't guess. Check from inside each dimension. Stand in the Nether, run /gamerule keep_inventory with no value, and see what it prints. If it says false, set it there too and do the same in the End. From the console, execute in minecraft:the_nether run gamerule keep_inventory true does it without going there. If you run Multiverse, you can set the rule on any world without going there:

/mv gamerule set keep_inventory true world_nether
/mv gamerule set keep_inventory true world_the_end
Multiverse, per world

Use /mv list first to see the exact world names your server uses.

What Keep Inventory Keeps, and What It Doesn't

On death, with keep inventory on
Inventory, hotbar, armour and offhand Kept
Experience levels Kept
Items with Curse of Vanishing Kept. The curse only deletes items that drop, and nothing drops
Health and hunger Reset, as on any respawn
Status effects Removed
Your respawn point Unchanged. You still go back to your bed, anchor or the world spawn

The Curse of Vanishing row surprises people. The game treats it as intended behaviour, and it means keep inventory is the one setting in the game that cancels the curse completely. Minecraft Curse of Vanishing, Explained covers what that does to a PvP economy.

Keep inventory is also all-or-nothing. It applies to every player in the world, with no per-player or per-group option in vanilla. If you want something in between, that takes a plugin. Graves plugins, or EssentialsX's /back with essentials.back.ondeath granted so players can get back to where they died, are the usual middle ground. EssentialsX Setup covers that permission, which is off by default.

Should a Server Turn It On?

It's a real gameplay decision rather than a quality-of-life tweak, so make it on purpose and tell the players.

  • Friends' SMP with no PvP: usually yes. Losing a full kit to lag or a creeper mostly makes people stop playing. Settle it as a group before the world starts. How to Make a Minecraft SMP Server for Friends covers the other settings worth agreeing on.
  • PvP or a player economy: usually no. With keep inventory on, a kill costs the loser nothing, gear never leaves the economy, and Curse of Vanishing stops mattering.
  • Hard or hardcore-style servers: no. Losing items is the stakes.

If a player has already lost a kit before you turned the rule on, you can't undo it with a game rule. You restore their player data file from a backup taken before the death. Editing Minecraft Player Data shows how to do that safely without rolling back the whole world.

Troubleshooting

  • "Incorrect argument for command" or "Invalid boolean". Check the spelling for your version (keep_inventory on 1.21.11 and later, keepInventory before) and make sure you typed true and not on.
  • "Unknown or incomplete command". You aren't at level 2 on that server, or commands are off in that world. On a server, run it from the Console instead, or see Minecraft Op Permission Levels.
  • It's refused in chat on Bedrock. Cheats are off in that world, or allow-cheats is false on a dedicated server. On a server, use the Console.
  • It works in one dimension and not another. On Paper, see the Nether and End section above.
  • It switched itself off. Usually the world was replaced: a reset, a new level-name, or an uploaded save that carries its own game rules. Run /gamerule keep_inventory to read the value, and set it again on the new world.

FAQ

What is the keep inventory command in Minecraft?

/gamerule keep_inventory true on Java Edition 1.21.11 and later, /gamerule keepInventory true on older Java versions, and /gamerule keepinventory true on Bedrock.

Does keep inventory keep XP?

Yes. Players keep their items and their experience levels. Health and hunger reset, and status effects are removed.

Do I need to restart the server after turning on keep inventory?

No. Game rules take effect immediately and are saved with the world, so they also survive restarts.

Can I turn on keep inventory for just one player?

Not in vanilla. The game rule applies to everyone in the world. Per-player or per-rank behaviour needs a plugin.

Does turning on keep inventory disable achievements?

On Bedrock, yes. Keep inventory needs cheats, and turning cheats on stops achievements in that world for good. Java advancements aren't blocked by commands.


Made with 💜 by GameServerKings

Need a Minecraft server?

Deploy an instantly-provisioned Minecraft server on high-clock hardware. DDoS protected, no contracts, cancel anytime.

From $4.80 /month