Skip to content
Thursday, November 12, 2026 · Console Gaming News, Reviews & Guides
Trending
Grand Summoners Tier List (Global, November 2026) Pokémon GO Shiny Odds: Every Rate by Method Pokémon Tier List: Which One You Actually Need What Is the Strongest Pokémon? Stats, Lore and Battle How to Make a Circle in Minecraft: Methods, Block Charts and Domes
Guides

How to Turn On Keep Inventory in Minecraft Java

How to turn on keep inventory in Minecraft Java: type /gamerule keep_inventory true on 1.21.11 and later. Why the old keepInventory command fails now.

Cassia Fenwick
Cassia Fenwick, Staff Writer
Published · 6 min read
Original game-style illustration for the Console Alley guide: How to Turn On Keep Inventory in Minecraft Java

To turn on keep inventory in Minecraft Java, open chat and type /gamerule keep_inventory true. That’s the command for Java 1.21.11 (released December 2025) and every version since, including the current 26.3 release. The old /gamerule keepInventory true only works on 1.21.10 and earlier, which is why so many older tutorials now end in an error.

You need commands allowed in a singleplayer world, or operator status on a server. If you’d rather not type anything, Java 26.1 added an in-game Game Rules screen. Everything below was checked against Java 26.3 in November 2026.

The Keep Inventory Command for Each Java Version

Mojang moved every game rule into a registry in 1.21.11 and renamed them all from camelCase to snake_case, so keepInventory became keep_inventory. Java treats rule names as case-sensitive, so the old spelling simply isn’t recognized anymore.

Version Turn on Turn off
Java 1.21.11, 26.1, 26.2, 26.3/gamerule keep_inventory true/gamerule keep_inventory false
Java 1.21.10 and older/gamerule keepInventory true/gamerule keepInventory false
Bedrock (for comparison)/gamerule keepinventory true/gamerule keepinventory false

Rule names per the Minecraft Wiki’s game rule list. The full Java ID is minecraft:keep_inventory; the prefix is optional.

Keep inventory commands typed in a chat windowTerminal-style window typing three commands: /gamerule keep_inventory true for Java 1.21.11 and 26.1 to 26.3, /gamerule keepInventory true for Java 1.21.10 and older, and /gamerule keepinventory true on Bedrock.chat# Java 1.21.11, 26.1–26.3/gamerule keep_inventory true# Java 1.21.10 and older/gamerule keepInventory true# Bedrock (for comparison)/gamerule keepinventory trueswap true for false to turn it off
Spot the difference: an underscore, a capital I, or all lowercase.

Not sure which version you’re on? Type /gamerule keep and press Tab. The game autocompletes whichever name your version accepts. Run /gamerule keep_inventory with no value to see the current setting. Copying a command from an older video? Swap in the new name and leave the true or false part as it is.

How to Turn On Keep Inventory in Minecraft Java Without Commands

Java has two menu routes, and neither needs you to type a thing. Which one you use depends on whether the world already exists.

For a new world:

  1. Click Singleplayer, then Create New World.
  2. Open the More tab and choose Game Rules.
  3. Under the Player category, switch Keep Inventory on.
  4. Click Done, then Create New World.

For an existing world on Java 26.1 or newer:

  1. Press Esc to open the pause menu.
  2. Click World Options, then Edit Game Rules.
  3. Type “keep” into the search bar and switch Keep Inventory on.

Per the Minecraft Wiki, that in-game screen arrived in 26.1 and works only for operators. In singleplayer, that means the world needs commands allowed. If the button is grayed out, the next section fixes it.

If Commands Are Off in Your World

Plenty of survival worlds are created with commands switched off. You don’t need to start over. On Java 26.2 and newer you can switch commands on from World Options; older versions need the Open to LAN trick.

Java 26.2 and newer:

  1. Press Esc and click World Options.
  2. Switch Allow Commands on (on 26.3 it’s in the General section).
  3. Run /gamerule keep_inventory true, or use Edit Game Rules on the same screen.

Java 26.1 and older:

  1. Press Esc and click Open to LAN.
  2. Set Allow Commands to ON (labeled Allow Cheats on older versions).
  3. Click Start LAN World, then run the command or use the game rules screen.

Skip the LAN route on 26.2 and newer: its command setting now applies only to players who join, not to you as the host.

The LAN commands permission resets when you quit, but the game rule doesn’t. Keep inventory is saved with the world, so it stays on after you reload, even with commands off again.

Servers, Realms and Paper

On a server, the rule belongs to the world, so one operator sets it for everyone. There’s no vanilla way to turn it on for just one player, and your own singleplayer settings never carry over to a server or Realms world you join, because each world stores its own rules.

  • Vanilla server console: type gamerule keep_inventory true with no slash. In-game, any operator can use the slash version.
  • Java Realms: the owner or an operator runs the same command in chat.
  • Paper, Spigot and other Bukkit servers: these keep game rules per dimension, so a plain command may only cover the world you’re standing in. Run execute in minecraft:the_nether run gamerule keep_inventory true, then the same with minecraft:the_end.
  • Servers still on 1.21.10 or older: use keepInventory instead.

What Keep Inventory Saves, and What It Doesn’t

With the rule on, you respawn with your full inventory, armor, offhand item and experience levels. Some things still reset, and they trip people up.

Problem Likely cause Fix
Command shows an errorOld keepInventory name on 1.21.11 or newerUse keep_inventory
Command not recognized, or no permissionCommands off, or you’re not an operatorAllow Commands in World Options (Open to LAN on 26.1 and older), or ask the server owner
Items kept in the Overworld, lost in the NetherPaper or Spigot per-dimension rulesSet the rule in each dimension with execute in
Items lost before you turned it onThe rule doesn’t act retroactivelyGet back to your death spot before the drops despawn

Health and hunger still reset on respawn, and status effects are cleared. One nice side effect: gear with Curse of Vanishing survives, because the curse only destroys items that would have dropped.

Should You Turn It On? Our Take

For building worlds, modded packs and friend servers where one creeper shouldn’t wipe a week of progress, yes. It also takes the sting out of learning hard fights like the Warden or the Wither. The trade-off is tension: death stops costing anything, and some players find survival goes flat without that risk. A middle path is to leave it off and switch it on for one scary job, then turn it back off with /gamerule keep_inventory false.

Playing Bedrock instead? The rule there is keepinventory, and you can toggle Keep Inventory in the world’s Cheats settings without typing anything.

More Minecraft guides: how to make obsidian and what Density does on a mace.

Keep Inventory FAQ

Does keep inventory save your XP in Minecraft Java?

Yes. With keep_inventory set to true, you respawn with your experience levels as well as your items. Nothing drops on the ground, so there’s no orb pile to collect either. Health and hunger still reset, and active potion effects are removed when you die.

Does keep inventory turn off achievements in Java?

No. Java advancements keep working with commands allowed, unlike Bedrock, where turning on cheats disables achievements for that world. That makes keep inventory a low-cost safety net on Java: your advancement progress carries on as normal after you flip the rule.

One command, one menu toggle, or one Allow Commands switch. Pick whichever your world allows, and stop losing diamonds to lava.

Cassia Fenwick
About the author

Cassia Fenwick

Cassia Fenwick is a staff writer at Console Alley, covering console gaming from the latest hardware questions to the games players return to for years. Her work moves across news, practical guides, reviews, gaming gear, and the wider culture around games. Whether she is breaking down a new console feature or explaining a mechanic in a familiar favorite, she writes with a straightforward goal: help readers understand what matters and what to do next. She pays particular attention to the small details that shape the playing experience. A controller compatibility rule, a battery-life setting, a difficult-to-find resource, or a change introduced by a game update can make the difference between a frustrating evening and a rewarding one. Her published coverage includes Nintendo Switch and Switch 2 questions, Terraria, Stardew Valley, and The Sims 4, with explanations that welcome readers who may be discovering a game for the first time or returning after time away. Cassia's style is clear, patient, and grounded in practical examples. Rather than assuming readers already know the terminology, she begins with the question at hand, adds the context that genuinely helps, and keeps instructions easy to follow. She is interested not only in how a feature works, but also why its design matters—especially when a small interaction, interface decision, or unexpected mechanic changes how a game feels. Outside her gaming coverage, Cassia enjoys colorful postcards, making books, and noticing the shapes, colors, and details built into everyday objects. That curiosity carries naturally into her writing, where overlooked features and thoughtful design can provide a fresh way to look at a game. Her aim is for every article to be useful on its own: approachable enough for a newcomer, specific enough for someone looking for a quick answer, and enjoyable enough to leave readers with something new to explore.

2 comments

Leave a Reply

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

More from Guides