Dying in Minecraft and watching all your carefully collected items scatter across the ground is genuinely one of the most painful experiences in the game. You spend an hour mining diamonds, get ambushed by a creeper, and suddenly you’re sprinting back to your death spot hoping nothing is lost. Sound familiar?
That’s exactly why Keep Inventory exists — and knowing how to turn on Keep Inventory in Minecraft Java can completely change how you play.
What Is Keep Inventory in Minecraft and Why Should You Use It?
Keep Inventory is a game rule in Minecraft that lets you hold onto all your items when you die. Normally, death drops everything from your inventory on the ground. With this rule enabled, you respawn with your full inventory intact. Your XP still resets, but your gear stays with you.
It’s not “cheating” — it’s a setting built right into the game. Plenty of players use it to:
- Focus on building and exploring without the frustration of losing progress
- Play with younger kids or beginners who get discouraged by item loss
- Test redstone contraptions or farms without risking their best gear
How to Turn On Keep Inventory in Minecraft Java (Step-by-Step)
This works in Minecraft Java Edition and takes about 10 seconds.
Step 1 — Open your world with cheats enabled.
If you created your world without cheats, you’ll need to enable them first. Go to Escape → Open to LAN → Allow Cheats: ON → Start LAN World. This is a temporary fix that resets when you close the game, but it gets the job done.
Step 2 — Open the chat window.
Press T on your keyboard to open the chat.
Step 3 — Type the command.
Enter this exactly
/gamerule keepInventory true
Make sure the capital “I” in keepInventory is correct — the command is case-sensitive.
Step 4 — Hit Enter.
You’ll see a confirmation message in the chat: “Game rule has been updated.” That’s it. Keep Inventory is now on.
To turn it back off at any time, just run:
/gamerule keepInventory false
What If the Command Isn’t Working?
A few common reasons this might fail:
- Cheats aren’t enabled — the /gamerule command requires cheats to be on. If you’re on a world where they’re off, use the LAN workaround mentioned above.
- Typo in the command — double-check the capital “I” in keepInventory. It’s the most common mistake.
- You’re on a server — if you’re playing on a multiplayer server, only an operator (OP) can run this command. You’ll need admin access or have to ask the server owner.
- Wrong edition — this guide is specifically for Java Edition. Bedrock Edition works differently, though the command is similar.
Does Keep Inventory Work in Hardcore Mode?
Short answer: no. Hardcore mode in Minecraft Java locks the difficulty at Hard and disables cheats entirely. Since /gamerule requires cheats, you can’t run it in a Hardcore world at all.
If you want Keep Inventory, you’ll need to be in Survival, Creative, or Adventure mode with cheats allowed.
One more thing worth knowing — XP still drops when you die even with Keep Inventory on. Your items are safe, but your experience levels will reset to zero. That’s just how the game rule works; there’s no separate toggle to keep XP through death in vanilla Java.
That’s the full picture. Keep Inventory in Minecraft Java is a one-line command that takes seconds to set up and can genuinely make the game more enjoyable depending on how you like to play. Run the command, confirm the chat message, and you’re good to go.
