KeepInventory in Minecraft — Never Lose Items on Death
Keep inventory in Minecraft: the keepInventory gamerule, how to enable it in Java and Bedrock, and what happens on death.
To keep your items when you die in Minecraft, run the command /gamerule keepInventory true — after that, dying leaves your entire inventory, armor, and hotbar on you instead of scattering it on the ground. The command requires cheats to be enabled and works in both Java and Bedrock Editions (the spelling is case-sensitive: keepInventory, capital I). Turn it back off anytime with /gamerule keepInventory false. This guide covers enabling cheats on both editions, exactly what the rule does and doesn't protect, how vanilla death drops work for context, and the settings worth knowing before you flip the switch.
The Command
Open chat (T on Java, the chat button on Bedrock) and run:
/gamerule keepInventory true
That's the whole process — no restart needed, and it applies to the world immediately and to every player in it. Key details:
- Case matters on Java:
keepinventoryall-lowercase fails; it must bekeepInventory. Bedrock auto-completes and is more forgiving, but type it correctly anyway. - It's a world rule, not a per-player setting — everyone on the server or LAN world gets item protection. There is no vanilla way to exempt one player.
- It persists: the rule is saved with the world. You set it once and it stays until changed, including across game updates.
- No confirmation appears by default beyond the standard gamerule feedback line; if you want to verify, run
/gamerule keepInventorywith no value to print the current state.
On Java you can also scope feedback with /gamerule sendCommandFeedback if you're running it from a command block — see the command block guide for automation.
Step 1: Enable Cheats First
/gamerule requires cheats/commands enabled in the world:
Java Edition — new world
- On the world creation screen, click More World Options.
- Set Allow Cheats: ON (or, in recent versions, toggle "Commands" on).
- Create the world and run the gamerule in chat.
Java Edition — existing world
- Pause, choose Open to LAN.
- Set Allow Cheats: ON (the "Enable Cheats" toggle in the LAN options).
- Start LAN World — cheats now work for this session.
- To make it permanent for a singleplayer world, quit and reopen the world, then edit
level.datwith an NBT editor, or simply run the LAN session each time. Alternatively, many players just re-open to LAN whenever they need a command.
Bedrock Edition — new or existing world
- Open the world's Settings from the world list (pause menu → Settings in-game works too for some options).
- Scroll to the Game settings and flip Cheats ON.
- Confirm the warning (achievements turn off for that world — this is permanent until you re-create the world without cheats).
- Run the gamerule from chat (tap the chat icon on touch devices).
Note the Bedrock tradeoff: turning cheats on disables achievements for that world permanently, while Java's LAN trick leaves achievements intact on the original save. Choose accordingly on an achievement run.
How Death Normally Works (What keepInventory Changes)
Understanding the default makes the rule's value clear. Vanilla death mechanics:
- All items in your inventory, hotbar, and armor slots drop at the death location in a scatter, with a pickup delay of about half a second.
- Most of your XP drops as experience orbs at the death spot — vanilla retains a small portion of your levels, and the dropped orbs can be collected if you make it back in time.
- Dropped items enter the standard 5-minute despawn timer (roughly 6,000 ticks), restarting only when chunks stay loaded — if you die 3,000 blocks away and take two hours to travel back, the items are gone.
- Items can land in lava, fall into ravines, or slide into cactus — the scatter doesn't care.
With keepInventory true:
- Your full inventory, armor, and hotbar stay on your body — you respawn with everything in place.
- You keep your XP levels (the full bar, unlike the vanilla partial retention).
- No drop scatter, no despawn clock, no lava roulette.
- What it does not protect: Curse of Vanishing items still vanish on death (that's the enchantment, independent of the gamerule), and your respawn mechanics are unchanged.
One caveat players forget: keepInventory protects items, not progress. You still respawn at your spawn point — if that's 2,000 blocks from where you died, you still face the walk back.
Should You Use It?
Honest framing: keepInventory is a difficulty-reducing quality-of-life rule, and the right answer depends on what you play for.
| Situation | Recommendation |
|---|---|
| Younger players, first survival world | On — removes the most rage-inducing loss loop |
| Hardcore mode | Unavailable — hardcore has no respawn at all |
| Achievement/replay-the-intended-way runs | Off — death drops are core survival tension |
| Building-focused or exploration-heavy worlds | Often on — the walk of shame back to your items adds nothing to a build session |
| Servers | Off by default; some communities allow it per-world via plugins |
Most long-term players land on: off while learning the combat loop, whatever you like after. The items themselves aren't sacred — a full diamond set is recoverable in an evening — but the timing of the loss (often mid-project, far from base) is what keepInventory actually smooths out.
Related Gamerules Worth Setting Together
Players who enable keepInventory usually tune a few neighboring rules at the same time:
| Command | Effect |
|---|---|
/gamerule keepInventory true | Keep items and XP on death |
/gamerule doImmediateRespawn true | Skip the death screen, respawn instantly |
/gamerule mobGriefing false | Mobs can't destroy blocks (creepers, endermen picking up) |
/gamerule doDaylightCycle false | Freeze time (daylight lock) |
/gamerule doFireTick false | Fire doesn't spread or burn out blocks |
/gamerule showDeathMessages false | Hides death messages in chat |
All follow the same syntax: /gamerule <name> <value> — see the all-commands list for the full catalog.
More Minecraft Guides
For the surrounding systems, see the Minecraft Hardcore Guide for the mode where death needs no gamerule because there's no respawn, the Minecraft Survival Tips Guide for dying less in the first place, and the Minecraft Beginner Guide for the fundamentals of your first world.
Related Guides
15 Essential Minecraft Survival Tips to Thrive in 2026
Master the blocky wilderness with these 15 essential Minecraft survival tips. From shelter building to combat, start thriving today.
25 Essential Minecraft Tips and Tricks for Survival, Building, and Exploration
Master the blocky world with these 25 Minecraft tips and tricks. From beginner survival to advanced redstone, level up your game today.
Games Hidden Inside Twitter: Tweetcraft, Minicraft & More
Games inside Twitter explained: Tweetcraft world links, Minicraft's single-post trick, AI browser ports, takedowns.
How to Enable Cheats in Minecraft — Java & Bedrock Guide
Enable cheats in Minecraft Java (world options or Open to LAN) and Bedrock (settings toggle), plus the top cheat commands: gamemode, tp, give.