Minecraft keep inventory command in Java 26.3 and Bedrock
Since Java 1.21.11, /gamerule keepInventory true no longer works: the rule is keep_inventory. The command for Java 26.3 and Bedrock, and the menus without it.
Keep inventory is the Minecraft game rule that keeps your items and your experience when you die. Its command depends on your edition, and in Java Edition it changed: since Java 1.21.11, out on December 9, 2025, /gamerule keepInventory true no longer works, because Mojang renamed every game rule. Here is what works today in Java 26.3 and in Bedrock, with the menus that need no command.
The command for each edition
Edition
Turn it on
Turn it off
Java 26.3 (since 1.21.11)
/gamerule keep_inventory true
/gamerule keep_inventory false
Java 1.21.10 and earlier
/gamerule keepInventory true
/gamerule keepInventory false
Bedrock
/gamerule keepinventory true
/gamerule keepinventory false
Without a value, /gamerule keep_inventory tells you whether the rule is on.
In Java, the game confirms with “Game rule keep_inventory is now set to true”. The old name only gets “Unknown or incomplete command. See below for error”.
Java also accepts the full name, minecraft:keep_inventory.
Java needs commands allowed in the world, or operator rights on a server. Bedrock needs cheats on.
Without a command, in Java 26.3
Press Esc and choose World Options...: since 26.3, this button sits where Open to LAN used to be.
Under General, turn on Allow Cheats. Until you do, Edit Game Rules... stays greyed out.
Choose Edit Game Rules... and, under Player, turn on Keep inventory after death.
A new world needs no cheats for it: Create New World, More tab, Game Rules, then the same switch. In a Hardcore world, the pause menu locks both: “Cannot change game rules in a hardcore world.”
In Bedrock
Open Settings, then Game. Under Cheats, turn on Activate Cheats, then Keep Inventory. The command does the same once cheats are on; without them, the game refuses it.
There is a price: a Bedrock world with cheats on stops earning achievements, and the game warns you: “If you start playing with these settings, achievements will no longer be earnable in this world.” Java has no achievements, and its advancements keep unlocking with cheats on: nothing in Java 26.3 ties them to commands.
What it keeps in Java
Your whole inventory, armor and off hand included, even items with Curse of Vanishing, which otherwise vanish when you die.
Your experience: no orbs drop, and you come back with the same level.
Not your health, hunger or effects: they reset, as after any death.
Your Ender Chest keeps its contents with or without the rule. With the rule off, the Recovery Compass leads you back to where you last died.
Old worlds keep their setting
A world where keepInventory was on before 1.21.11 keeps it on: the game converts the old rules when it opens the world. What writes the old name by hand has to change: the commands you type, command blocks and data packs.
The other rules that changed name
Every Java game rule is now written in lowercase, with underscores. 32 of them, keepInventory among them, only changed spelling: mobGriefing became mob_griefing, fallDamage became fall_damage. The others got a new name, in the table below, and three of them work the other way around: disableRaids true is now raids false. Two fire rules, doFireTick and allowFireTicksAwayFromPlayer, became one: fire_spread_radius_around_player, the distance in blocks fire can spread around a player, where 0 stops fire from spreading and -1 lets it spread with no player around.
Before 1.21.11
Since 1.21.11
In the menu (Java 26.3)
announceAdvancements
show_advancement_messages
Announce advancements
commandBlocksEnabled
command_blocks_work
Enable Command Blocks
commandModificationBlockLimit
max_block_modifications
Command modification block limit
disableElytraMovementCheck
elytra_movement_check (reversed: true and false swap)
Do elytra movement check
disablePlayerMovementCheck
player_movement_check (reversed: true and false swap)
Do player movement check
disableRaids
raids (reversed: true and false swap)
Do raids
doDaylightCycle
advance_time
Advance time of day
doEntityDrops
entity_drops
Drop entity equipment
doImmediateRespawn
immediate_respawn
Respawn immediately
doInsomnia
spawn_phantoms
Spawn phantoms
doLimitedCrafting
limited_crafting
Require recipe for crafting
doMobLoot
mob_drops
Drop mob loot
doMobSpawning
spawn_mobs
Spawn mobs
doPatrolSpawning
spawn_patrols
Spawn pillager patrols
doTileDrops
block_drops
Drop blocks
doTraderSpawning
spawn_wandering_traders
Spawn Wandering Traders
doVinesSpread
spread_vines
Vines spread
doWardenSpawning
spawn_wardens
Spawn Wardens
doWeatherCycle
advance_weather
Update weather
maxCommandChainLength
max_command_sequence_length
Command chain size limit
maxCommandForkCount
max_command_forks
Command context limit
minecartMaxSpeed
max_minecart_speed
Minecart max speed
naturalRegeneration
natural_health_regeneration
Regenerate health
snowAccumulationHeight
max_snow_accumulation_height
Snow accumulation height
spawnRadius
respawn_radius
Respawn location radius
spawnerBlocksEnabled
spawner_blocks_work
Enable Spawner Blocks
doFireTick, allowFireTicksAwayFromPlayer
fire_spread_radius_around_player
Fire spread radius
In Bedrock, the rule is still called keepinventory. The rest of Java 26.3 is in our 26.3 article.
01What is the keep inventory command in Minecraft?
In Java 26.3, and since Java 1.21.11: /gamerule keep_inventory true. In Java 1.21.10 and earlier: /gamerule keepInventory true. In Bedrock: /gamerule keepinventory true. Replace true with false to turn it off. Java needs commands allowed in the world, Bedrock needs cheats on.
02Why doesn't /gamerule keepInventory true work anymore?
Since Java 1.21.11, out on December 9, 2025, every Java game rule is written in lowercase, with underscores: keepInventory became keep_inventory, and the old name only gets “Unknown or incomplete command. See below for error”. A world where the rule was on keeps it on: the game converts the old rules when it opens the world.
03How do you turn on keep inventory without a command?
In Java 26.3: press Esc, choose World Options..., turn on Allow Cheats, then choose Edit Game Rules... and, under Player, turn on Keep inventory after death. For a new world: More tab, Game Rules. In Bedrock: Settings, Game, then under Cheats, Activate Cheats and Keep Inventory.
04Does keep inventory disable achievements?
In Bedrock, yes: Keep Inventory needs cheats on, and a world with cheats on stops earning achievements. Java has no achievements, and its advancements keep unlocking with cheats on.
05Does keep inventory keep your experience?
Yes, in Java: no orbs drop, and you come back with the same level. You also keep your whole inventory, armor and off hand included, even items with Curse of Vanishing. Health, hunger and effects reset, as after any death.
Minecraft Java 26.4 Pre-Release 1, out November 24, starts The Deep Freeze's last testing stage: 73 bug fixes, old Nether Fortresses fixed, Data Pack 128.1, no release date yet.
Minecraft Krillion, the fan-made rare-answer trivia game: who makes each version, their rules, and how many mobs, biomes and enchantments Java 26.3 really holds.
Minecraft Java 26.4 Snapshot 9 makes Vulkan the default for good, gives Improved Fog its own setting, adds a Repeat Recipe/Trade key and data-driven dispensers.