How To Video Game

Minecraft: How to Turn On Keep Inventory

A player steps out of a lit obsidian Nether portal while two others watch, with netherrack, magma blocks and lava spread across the ground beside a lake in Minecraft

To turn on keep inventory in Minecraft Java Edition, type /gamerule minecraft:keep_inventory true in chat (the rule was renamed from keepInventory in the 1.21.11 update), or flip it in the Game Rules screen. In Bedrock Edition, turn on Keep Inventory in the Cheats section of your world settings, or type /gamerule keepinventory true, but either way it needs cheats, which permanently disables achievements for that world. Below we cover every method on both editions, what keep inventory actually saves, and how it works on Realms and servers.

This guide is current for Minecraft Java Edition 26.3 and Bedrock Edition 26.50.

What Keep Inventory Does

Keep inventory is a game rule, off by default, that changes what happens when you die. The rule description reads: “Whether the player should keep items and experience in their inventory after death.” With it on:

  • Your items stay in your inventory, including armor and the offhand slot, instead of spilling on the ground.
  • Your experience stays too, so you respawn with your levels intact.
  • Curse of Vanishing does not trigger, so cursed items survive as well.

It applies to every player in the world, not just the one who turned it on.

How to Turn On Keep Inventory in Java Edition

Method 1: the command.

  1. Make sure commands are allowed in the world (see below if they are not).
  2. Press T (or /) to open chat.
  3. Type /gamerule minecraft:keep_inventory true and press Enter.

Mojang’s 1.21.11 changelog moved every game rule into a registry with namespaced snake case names, which is why the old /gamerule keepInventory true no longer matches on current versions. As with item IDs, the minecraft: prefix can usually be left off, so /gamerule keep_inventory true works as well. If you play an older version, such as a modpack on 1.21.10 or earlier, use keepInventory. To turn it off, run the same command with false.

Method 2: the Game Rules screen, in an existing world.

  1. Press Esc and select World Options.
  2. Select Edit Game Rules.
  3. Type “keep” in the search bar (added in Java 26.1) and turn on the keep inventory rule.

Mojang’s notes say the Game Rules screen is only available to operators. In single player, that means Allow Commands has to be on first. Since Java 26.2, you can switch it on in the same World Options screen, with no need to open the world to LAN, though Mojang notes the button is not available in Hardcore.

Method 3: when creating a world. On the Create New World screen, open the More tab, select Game Rules, search for “keep” and turn it on before you create the world.

How to Turn On Keep Inventory in Bedrock Edition

Bedrock’s steps are the same on Windows, Xbox, PlayStation, Switch and mobile.

From the world settings:

  1. Select Play, then the pencil icon next to your world (or pause in-game and select Settings).
  2. Go to the Cheats section and turn on cheats.
  3. Turn on Keep Inventory.

With a command: in a world with cheats on, open chat and type /gamerule keepinventory true.

The achievement catch. Keep inventory is a cheats-only rule on Bedrock, and Mojang says enabling cheats permanently stops players from unlocking achievements in that world, even if you turn cheats off again later. If you are hunting achievements, make a copy of the world first and experiment on the copy.

Keep Inventory on Realms and Servers

  • Bedrock Realms: the owner or an admin opens the Realm’s Edit World screen from the Realms Hub. Per Mojang’s help center, that screen is where cheats get turned on, after which the Keep Inventory toggle and the command both work.
  • Java Realms: the owner (or any player they make an operator) runs /gamerule minecraft:keep_inventory true in chat.
  • Java and Bedrock servers: an operator runs the same command in game, or the server admin types it into the server console without the slash.

Regular players cannot change it on someone else’s world, so ask the host. Our guide to playing with friends covers each way of sharing a world.

If You Would Rather Not Cheat

Keep inventory takes the sting out of dying, but a few non-cheat habits do much of the same job:

  • Note your coordinates before risky trips. Our guide to showing coordinates explains how, and a death spot is much easier to find again with numbers.
  • Carry a recovery compass, which points to where you last died. It is crafted from echo shards, found in the chests of ancient cities.
  • Hurry. Dropped items despawn after five minutes in a loaded area, so head straight back.
  • Protect your gear. A pickaxe with Mending repairs itself with experience, and our best enchantments guide lists what else is worth putting on the gear you do not want to lose.

Find more on our Minecraft guides hub.

Frequently Asked Questions

Why is /gamerule keepInventory true not working? Java 1.21.11 renamed the rule. Use /gamerule minecraft:keep_inventory true on Java, and /gamerule keepinventory true on Bedrock. Commands also have to be allowed in the world.

Does keep inventory disable achievements? On Bedrock, yes, because it requires cheats, and the lock is permanent for that world. Java Edition has no achievement lock, and advancements keep working.

Does keep inventory save your XP? Yes. The rule keeps both items and experience, so you respawn with the same level.

Can I turn on keep inventory without cheats? On Java, you can set it on the Create New World screen before the world exists. On Bedrock, no: it is a cheats-only setting.

Does keep inventory work in multiplayer? Yes. It is a world rule, so it covers every player, but only the host, a Realm owner or admin, or a server operator can turn it on.

More Minecraft