Skip to content
Minecraft

How to turn on keep inventory in Minecraft

Published on 3 October 2026

The keep inventory command is /gamerule keep_inventory true in Java and /gamerule keepinventory true in Bedrock. After that you keep your items and experience when you die, and in Bedrock you can also flip the Keep Inventory toggle under Cheats.

Mind the spelling: since Java 1.21.11 every game rule has a new name, in lowercase with underscores. Guides that say keepInventory were written before that. Checked against Java 26.3 and Bedrock 26.52.

What does keep inventory do?

  • You keep your inventory, armor and experience levels when you die.
  • Health and hunger still reset, and potion effects are cleared.
  • Items with Curse of Vanishing don’t vanish.
  • It applies to the whole world, so to everyone playing on it.

Keep inventory is off by default. You can’t turn it on in a singleplayer hardcore world, because commands and game rules are locked there.

How do you turn on keep inventory in your own world?

Java, new world: on the Create New World screen, open the More tab and choose Game Rules. Under Player, switch on Keep inventory after death.

Java, existing world:

  1. Press Esc and choose World Options. This menu has been in the pause menu since 26.1.
  2. If commands are off, switch on Allow Commands. Hosts can do that since 26.2.
  3. Choose Edit Game Rules and search for inventory.
  4. Switch on Keep inventory after death and save.

You can also type /gamerule keep_inventory true in chat. Type /gamerule keep_inventory without a value to check whether it’s on.

Bedrock: open your world settings, go to Cheats, switch on Activate Cheats and then Keep Inventory. The command works too. Be aware that once cheats are on in a Bedrock world, you can’t earn achievements there anymore, even if you switch them off again.

How do you turn it on in Realms and Aternos?

  • Java Realm: the owner is always an operator, so just type the command in chat.
  • Bedrock Realm: the owner switches it on in the world settings under Cheats. That also ends achievements for that world.
  • Aternos: change it in your world’s options on the Worlds page, or type the command in the console.

Weighing up a Realm, Aternos and your own server? Read Minecraft Realms vs your own server and when a paid server is worth it.

How do you enable keep inventory on your server?

  1. Open your server’s console in the game panel. See how to use your server console.
  2. Type gamerule keep_inventory true and press Enter. Leave out the slash in the console.
  3. Running a Bedrock server? Type gamerule keepinventory true instead.
  4. Check it. Type the rule without true; the console tells you whether it’s on.

Operators can also do this in game with the slash in front, or in Java through World Options and Edit Game Rules. If your server runs Paper or another Bukkit-based server, game rules can apply per dimension, so to be safe switch it on in the Nether and the End as well:

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

Can you turn it on for some players only?

Not with the game rule itself, which applies to everyone. To set it per player or per rank you need a plugin or data pack. Search Modrinth or Hangar for keep inventory or graves. Graves are little tombstones that hold your items until you collect them. Pick one that matches your server version and test it first. Our guide to installing plugins on your Minecraft server explains how to add one.

Other handy game rules, like skipping the night with a single player in bed, are in our list of useful Minecraft commands.

Want to set your own rules? On your own Minecraft server you decide whether players keep their items, which plugins run and who gets in. See the Minecraft plans.

Frequently asked questions

What is the keep inventory command in Minecraft?

In Java since 1.21.11: /gamerule keep_inventory true. In Bedrock: /gamerule keepinventory true. In a server console, leave out the slash.

Why doesn’t /gamerule keepInventory true work anymore?

Java renamed every game rule in 1.21.11, using lowercase and underscores. The correct name is now keep_inventory. Bedrock still uses keepinventory.

Do you keep your XP with keep inventory?

Yes. You keep your items, armor and experience levels. Health and hunger still reset and potion effects disappear.

Can you turn on keep inventory without cheats?

In Java you can switch on Allow Commands in World Options since 26.2 and then change the game rule. In Bedrock cheats have to be on, which turns off achievements in that world.

Does keep inventory work for everyone on a server?

Yes, the game rule covers the whole world. On Paper servers it can differ per dimension, so set it in the Nether and the End as well. Per-player settings need a plugin.

More questions? See all frequently asked questions

Related articles