Skip to content
Guides

How to Turn On Keep Inventory in Minecraft Java

How to turn on keep inventory in Minecraft Java: type /gamerule keep_inventory true. Covers the 1.21.11 rename, 26.3 menus and fixes.

How to Turn On Keep Inventory in Minecraft Java

Here is how to turn on keep inventory in Minecraft Java: open your world with commands allowed and type /gamerule keep_inventory true in chat.

That is the correct command on Java 1.21.11 and every later version, including the current release, 26.3.

Older guides tell you to type /gamerule keepInventory true. That spelling now only fits Java 1.21.10 and earlier, because Mojang renamed every game rule in snapshot 25w44a, ahead of 1.21.11 (source: Minecraft Wiki, game rule history).

Keep inventory is a game rule in Minecraft, Mojang Studios’ sandbox survival game, that stops your items and experience from dropping when you die. It is off by default, according to the Minecraft Wiki’s game rule list.

Applies to Minecraft Java Edition 26.3, released September 15, 2026, on PC, Mac and Linux. Last checked October 7, 2026.

This guide is research-based. It draws on Mojang’s official 26.3 patch notes and the Minecraft Wiki, and we have not tested every step in-game.

Which keep inventory command works on your Java version?

Use /gamerule keep_inventory true on Java 1.21.11 and later, and /gamerule keepInventory true on 1.21.10 and earlier. Bedrock Edition uses a third spelling, keepinventory.

Minecraft version

Command to turn it on

Source

Java 26.3, 26.2, 26.1 and 1.21.11

/gamerule keep_inventory true

Minecraft Wiki, game rule page

Java 1.21.10 and earlier

/gamerule keepInventory true

Minecraft Wiki, game rule history

Bedrock Edition

/gamerule keepinventory true

Minecraft Wiki, game rule page

Java arguments are case sensitive, according to the Minecraft Wiki’s /gamerule page, so type the name in lowercase with the underscore.

The minecraft: prefix is optional, so /gamerule minecraft:keep_inventory true does the same thing, per DoomHosting’s September 2026 guide.

How to turn on keep inventory in Minecraft Java with a command (step by step)

Open chat, type /gamerule keep_inventory true and press Enter. On Java, the command needs permission level 2, according to the Minecraft Wiki.

1.     Load the world you want to change. The rule is saved per world, so your other saves stay as they are.

2.     Turn on commands if they are off (see the next section).

3.     Press T to open chat. Pressing / also works and types the slash for you.

4.     Type /gamerule keep_inventory true and press Enter.

5.     Run /gamerule keep_inventory with no value. Chat reports the current setting, which should now read true.

If chat rejects the rule name, type /gamerule and let the suggestions fill it in. Press Tab to accept one.

How do you allow commands in an existing Java world on 26.3?

Press Esc, click World Options and switch Allow Commands on. In 26.3 this replaced the Open to LAN route that older guides describe, according to Mojang’s official 26.3 patch notes (September 15, 2026).

1.     Press Esc to open the Game Menu.

2.     Click World Options. It now sits where the Open to LAN button used to be.

3.     In the General section, switch Allow Commands on.

4.     Close the menu and run the command from the section above.

Allow Commands is singleplayer only and cannot be changed in Hardcore, according to the Minecraft Wiki’s World Options page (updated September 17, 2026).

Guides written before September 15, 2026 tell you to use Open to LAN, then Allow Cheats, then Start LAN World. That route applied through 26.2. In 26.3, LAN settings moved into the Multiplayer section of World Options.

Creating a new world instead? Switch Allow Commands on in the Create New World screen. It defaults to off there, per the Minecraft Wiki.

Can you turn on keep inventory in Minecraft Java without a command?

Yes. On Java 26.1 and later, open World Options, click Edit Game Rules and switch keep inventory on. Mojang added the in-game game rules screen in 26.1, per the Minecraft Wiki.

1.     Press Esc and click World Options.

2.     In the General section, click Edit Game Rules.

3.     Type keep_inventory in the search bar, or open the Player category.

4.     Switch the rule on and close the screen.

The screen only works for operators, according to the Minecraft Wiki, and the Edit Game Rules button is locked in Hardcore worlds. The Create New World screen has the same menu if you want the rule on before you spawn.

How do you turn on keep inventory on a Java server?

Run gamerule keep_inventory true in the server console, or /gamerule keep_inventory true in chat as an operator. Lilypad’s Java 26.3 gamerule guide (updated September 25, 2026) lists the same command.

1.     Open the server console from your host’s panel or your terminal.

2.     If you are not an operator yet, run op yourusername.

3.     Run gamerule keep_inventory true. The console does not need the leading slash.

4.     Run gamerule keep_inventory to confirm the value.

The rule applies to every player in that world. The base game exposes one on/off value for the whole world, according to the Minecraft Wiki, so there is no per-player switch.

Hosting guides mention datapacks or plugins for per-player control. We have not tested any, so check a pack’s own page before you trust it.

What does keep inventory keep in Minecraft Java?

Keep inventory keeps your items and experience after death. Health, hunger and status effects still reset, according to the Minecraft Wiki’s game rule page (checked October 7, 2026).

What

After you die with keep inventory on

Items in your inventory

Kept

Experience

Kept

Health and hunger

Reset as normal

Status effects

Removed

Items with Curse of Vanishing

Do not disappear

Mojang’s bug tracker lists the effect removal (MC-67352) and the Curse of Vanishing behavior (MC-108353) as Works As Intended, per the wiki’s references.

Why is keep inventory not working in Minecraft Java?

The most likely cause is the old keepInventory spelling on a newer version. Switch to keep_inventory and try again.

1.     You used the old rule name. Guides disagree on whether it still works: mc-node’s knowledge base (September 2026) reports “Incorrect argument for command” on newer versions. We could not test it, so use keep_inventory.

2.     Commands are off, or you are not an operator. Turn on Allow Commands in World Options, or run op yourusername on a server.

3.     You made a typo. Java is case sensitive, so use lowercase letters and the underscore.

4.     You are in the wrong world. The rule belongs to one world, so run /gamerule keep_inventory in the world where you died.

Does this work on PlayStation, Xbox, Switch or mobile?

Not as written. Those versions run Bedrock Edition, which uses /gamerule keepinventory true in lowercase, according to the Minecraft Wiki.

Bedrock also puts a Keep Inventory switch in the Cheats section of world settings. Turning on cheats can disable achievements for that world, per the Minecraft Wiki.

How do you turn keep inventory off again?

Run /gamerule keep_inventory false. Deaths drop items and experience as normal from that point, and the rule’s default is false (Minecraft Wiki). Run the command with no value to check the current setting.

What could change in the next Minecraft Java update?

Menu paths are the part most likely to date. Mojang moved World Options in 26.3, and the Minecraft Wiki lists Java 26.4 snapshots in testing as of October 7, 2026.

Recheck the rule name and the World Options layout when 26.4 ships. The rename from keepInventory to keep_inventory has held through 26.3.

Minecraft Java keep inventory FAQ

What is the command to keep inventory in Minecraft Java?

Type /gamerule keep_inventory true on Java 1.21.11 and later, including 26.3. On Java 1.21.10 and earlier, the command is /gamerule keepInventory true.

Why doesn’t /gamerule keepInventory true work in Java 26.3?

Mojang renamed every game rule in snapshot 25w44a, ahead of 1.21.11, so the camelCase name belongs to older versions. Use /gamerule keep_inventory true instead.

How do I turn on keep inventory in Minecraft Java without commands?

Open World Options from the Game Menu, click Edit Game Rules and switch keep inventory on. This works on Java 26.1 and later, and only for operators.

Does keep inventory keep XP in Minecraft Java?

Yes. The Minecraft Wiki says players also retain their experience on death. Health and hunger still reset, and status effects are removed.

Does keep inventory work in Hardcore mode?

The rule exists in every world, but a Hardcore death still ends your run, so it protects little. The Allow Commands and Edit Game Rules buttons are also locked in Hardcore, per the Minecraft Wiki.

Portrait of Tom Gallagher

Tom Gallagher

Hardware editor, Arcade Monthly

Tom tests controllers, handhelds and displays for Arcade Monthly, with a multimeter close at hand.

Full biography and stories

More from Arcade Monthly

Leave a Reply

Your email address will not be published. Required fields are marked *