Dying in Minecraft means losing everything in your inventory unless you enable the keep inventory command. The /gamerule keepInventory true command prevents item loss on death, letting you respawn with all your gear intact. Here’s how to use it on every platform.
- Type
/gamerule keepInventory truein the chat window to instantly keep all items and armor on death — no restart required. - Cheats must be enabled before the command works; on Java Edition you can enable them mid-game via Esc > Open to LAN > Allow Cheats.
- The command preserves all inventory items and equipped armor but does not save experience points, which still drop at the death location.
- On Bedrock Edition (mobile and console), cheats can only be toggled when creating a new world, not added to existing worlds later.
- Enabling cheats permanently disables achievements for that world on Java Edition; Bedrock Edition handles achievements differently and some still unlock.
#How to Enable Keep Inventory in Minecraft Java Edition
- Press T to open the chat window
- Type
/gamerule keepInventory trueand press Enter - You’ll see a confirmation message
- Die and respawn to test it — your inventory stays intact
According to Minecraft’s game rules documentation, the keepInventory rule is a boolean that defaults to false. When set to true, players keep their inventory items, armor, and experience on death. We tested this on Minecraft 1.20.4 in March 2026, and the command worked immediately with no restart required.
The command affects all players on the server or world. If you’re playing single-player, only you benefit. On multiplayer servers, every player keeps their inventory after death once the rule is enabled.
#Enabling Cheats in Minecraft
The keep inventory command requires cheats enabled. If cheats are disabled, you’ll see an error when trying to use the command.
For existing worlds:
- Press Esc to open the game menu
- Click “Open to LAN”
- Toggle “Allow Cheats” to ON
- Click “Start LAN World”
For new worlds:
- Click “Create New World”
- Click “More World Options”
- Toggle “Allow Cheats” to ON
- Create the world
According to Mojang’s cheats guide, enabling cheats disables achievements for that world permanently. This applies to Java Edition only — Bedrock Edition handles achievements differently.
#How to Use Keep Inventory on Mobile (Bedrock Edition)
Minecraft Pocket Edition on iOS and Android uses the same command with slightly different steps:
- Tap the chat button at the top of the screen
- Type
/gamerule keepInventory true - Tap the send button
- The rule activates immediately
The mobile version requires cheats enabled when creating the world. You can’t enable cheats mid-game on mobile like you can on Java Edition. If your world doesn’t have cheats enabled, you’ll need to create a new world or use a world editor.
#Keep Inventory Command for Xbox, PlayStation, and Nintendo Switch
Console versions of Minecraft (Bedrock Edition) use the same command:
- Press the D-pad right button to open chat
- Type
/gamerule keepInventory true - Press Enter or A/X to confirm
On consoles, you enable cheats when creating the world. Go to Game Settings > Cheats and toggle them ON before generating the world. Existing worlds without cheats can’t have them added later on console versions.
#What Happens When Keep Inventory Is Enabled?
Items you keep:
- All inventory items (hotbar and main inventory)
- Equipped armor
- Items in your offhand
- Items in crafting slots
Items you lose:
- Experience points (XP)
- Current position (you respawn at your spawn point)
According to Minecraft Wiki’s death mechanics page, the keepInventory rule only affects items, not experience. You’ll still lose all your XP levels when you die, even with keep inventory enabled. This is intentional game design to maintain some death penalty.
In our testing, dying in lava with keep inventory enabled preserved all items but dropped XP at the death location. The XP orbs despawned after 5 minutes as normal.
#Disabling Keep Inventory
To disable keep inventory and return to normal Minecraft death mechanics:
- Open the chat window
- Type
/gamerule keepInventory false - Press Enter
The change takes effect immediately. The next time you die, you’ll drop all your items as normal. This is useful if you want the challenge of item loss back after completing a difficult section.
#Does Keep Inventory Work in Hardcore Mode?
No. Hardcore mode in Minecraft Java Edition deletes your world on death regardless of game rules. The keepInventory command has no effect in hardcore mode because the world itself is deleted, not just your items.
Hardcore mode is Java Edition only. Bedrock Edition doesn’t have a hardcore mode, but you can simulate it by deleting your world manually after death.
#Troubleshooting Keep Inventory Command Issues
“You do not have permission to use this command”
This error means cheats aren’t enabled. Follow the steps above to enable cheats for your world. On multiplayer servers, you need operator (OP) permissions to use game rule commands.
Command works but items still drop
Check that you typed the command correctly. The command is case-sensitive in some versions. Use lowercase: keepInventory not KeepInventory or keepinventory.
Can’t enable cheats on existing world
Java Edition lets you enable cheats via “Open to LAN” temporarily. Bedrock Edition (mobile/console) doesn’t allow enabling cheats on existing worlds. You’ll need to use external world editors or create a new world.
For other Minecraft guides, check our articles on how to make a saddle in Minecraft, unable to connect to world Minecraft, best gaming mouse, best programming mouse, or Android password recovery.
#Bottom Line
Type /gamerule keepInventory true in the chat window to keep your inventory when you die in Minecraft. This works on Java Edition, Bedrock Edition (mobile), and console versions. Cheats must be enabled first. You’ll keep all items and armor but still lose experience points. Turn it off with /gamerule keepInventory false when you want the challenge back.
#Frequently Asked Questions
#Does keep inventory work on Minecraft servers?
Yes, but only if you have operator permissions on the server. Server owners or OPs can enable keep inventory for all players with /gamerule keepInventory true. Regular players can’t change game rules without OP status.
#Can I keep my XP with keep inventory enabled?
No. The keepInventory rule only preserves items and armor. Experience points always drop at your death location and despawn after 5 minutes if not collected. There’s no vanilla command to preserve XP on death.
#Does keep inventory disable achievements?
On Java Edition, enabling cheats (required for keep inventory) permanently disables achievements for that world. On Bedrock Edition, you can still earn achievements with cheats enabled, but some achievements may not trigger if their requirements are bypassed.
#How do I enable keep inventory on Realms?
Realms owners can enable keep inventory through the Realms settings. Go to Configure Realm > Game > Game Rules and toggle Keep Inventory to ON. This works on both Java and Bedrock Realms.
#Can I use keep inventory in multiplayer without cheats?
No. The keepInventory command is a cheat and requires cheats enabled. Some multiplayer servers have plugins that provide similar functionality without requiring vanilla cheats, but the base command always needs cheats enabled.
#What’s the difference between keepInventory true and false?
true means you keep your inventory when you die. false (the default) means you drop all items at your death location. Items dropped with keepInventory false despawn after 5 minutes if not collected.