Keep Inventory Command in Minecraft: How to Keep Your Inventory Upon Death
We’ve all been through that traumatic situation in Minecraft: you’ve spent hours mining, your inventory is full of diamonds, enchanted armor, and valuable materials. Suddenly, a wrong step leads you into a lava lake, or you’re pushed into the void by the Ender Dragon. The red “You died” screen appears, and panic sets in. You know you have only 5 minutes to recover your things before they disappear (despawn), if they haven’t burned up already.
For many players, this punishing mechanic is part of the thrill. But for others, losing hours of progress over a simple mistake ruins the gaming experience. This is where the keep inventory command comes in.
In this article, we’ll explore in depth how to use this essential “cheat,” covering all versions of the game, from how to activate the command in Java to Bedrock, and solving the most common questions.
What is Keep Inventory in Minecraft?
The term Keep Inventory refers to a “Gamerule” (game rule) that alters the standard behavior of death in Minecraft. By default, when you die, your items are scattered from your body, and your experience level is drastically reduced, leaving only a small portion on the ground.
By activating the command to keep your inventory, you change this reality: upon death, you respawn at your bed or spawn point with your armor on, all your items in your backpack, and your experience bar intact. It’s the perfect tool for those looking for a more relaxed experience or for servers where the focus is on building and adventure without frustration.
The Exact Command: Syntax and Writing
Before diving into the differences between versions, you must know the universal syntax of the command. To activate this function through the chat, you must type the following:
/gamerule keepInventory true
Attention! Writing is crucial here. Minecraft (especially in Java) is case-sensitive.
- Correct:
keepInventory(with a capital ‘I’). - Incorrect:
keepinventoryorKeepInventory.
If you type the command and receive an error message in red, you likely missed the capital “I.”
How to Set Keep Inventory in Minecraft Java Edition
The Java version is the original and sometimes the one that most confuses new users due to cheat management. Below, we explain how to set keep inventory in Minecraft Java depending on whether you are creating a world or already playing.
1. In a New World
When creating a new world, you don’t need to write codes if you don’t want to.
- Go to “Create New World.”
- Look for the “Game Rules” button or tab.
- In the list, look for the option “Keep inventory after death” and change it to “ON” (True).
- Create the world, and you’re set.
2. In an Existing World (with cheats enabled)
If you already allowed commands when creating the world, simply open the chat (T key) and type:
/gamerule keepInventory true
The game will respond: “Gamerule keepInventory has been updated to true.”
3. In an Existing World (WITHOUT cheats enabled)
This is the most common problem. You created a strict survival world and now regret it, but the game won’t let you use the keep inventory command. Here’s the trick to fix it:
- Press Esc to go to the pause menu.
- Click on “Open to LAN.”
- In the options that appear, change “Allow Cheats” to “ON.”
- Click on “Start LAN World.”
- Now, quickly open the chat and type
/gamerule keepInventory true.
This method works regardless of the version. If you’re wondering how to set keep inventory in Minecraft 1.16.5 or older versions like 1.12.2, the syntax is exactly the same. The /gamerule command has been very stable throughout the history of Java Edition, so you won’t have compatibility issues.
How to Set Keep Inventory in Minecraft Bedrock
If you play on console (PS4, Xbox, Switch), mobile (PE), or Windows 10/11 Edition, you are playing Bedrock. Here, knowing how to set keep inventory in Minecraft Bedrock is a bit more visual and accessible.
There are two main ways to do it:
Method 1: From the Settings Menu (No commands)
This is the easiest way and doesn’t require using the console’s virtual keyboard.
- Press pause and enter “Settings.”
- In the “Game” section (the first tab), scroll down to find the “Cheats” section.
- Make sure the “Activate Cheats” option is turned on. (Note: this will permanently disable achievements in that world).
- Keep scrolling down until you find the option that says “Keep Inventory.”
- Toggle the switch to the right.
Method 2: Using the Chat
If you are the world administrator (host) and have cheats enabled, you can do it just like on PC:
- Open the chat (Right D-Pad button on consoles or the chat icon on mobiles).
- Type:
/gamerule keepinventory true.
Note: In Bedrock, the system is sometimes more permissive with capitalization, but it’s recommended to use the capital ‘I’ out of habit.
Differences and Curiosities Between Versions
Although the goal of keeping inventory in Minecraft is the same across all platforms, there are interesting nuances.
Old Versions (1.12.2 and earlier): Many technical mod players still play on 1.12.2. If you’re looking for how to set keep inventory in Minecraft 1.12.2, you’ll be glad to know it works perfectly via chat. However, in these older versions, the detailed “Game Rules” visual menu did not exist when creating a world, so you will rely almost exclusively on the written command.
Modern Versions (1.16.5, 1.20, 1.21): For those looking for how to set keep inventory in Minecraft 1.16.5 (the Nether update) or higher, Mojang made things much easier by integrating the option into the graphical interface for world creation. This allows you to start your adventure in the Nether without the constant fear of losing your equipment in the lava.
Is it Considered Cheating?
This is an eternal discussion in the community. By looking for a command not to lose your inventory, you are technically activating “cheats.” This has consequences:
- In Bedrock: Permanently disables achievements/trophies in that world.
- In Java: Does not affect anything external, as Java doesn’t have a global achievement system linked to your account, only internal advancements.
However, many veteran players consider keep inventory in Minecraft not a cheat, but an “alternative difficulty setting.” Minecraft is a sandbox game; the idea is for you to have fun. If the anxiety of losing your items prevents you from exploring dangerous caves or fighting the Wither, activating this option can make the game much more enjoyable for you. Don’t let purists tell you how to play your own world.
How to Disable Keep Inventory?
If at any point you feel the game has become too easy and you want to recover the adrenaline of risk, you can easily reverse the process.
Simply open the chat and type the inverse command:
/gamerule keepInventory false
By doing this, the next time you die, your items will drop to the ground as usual.
Common Troubleshooting
Sometimes, you type the keep inventory command and it doesn’t seem to work. Here are the most likely causes:
- Lack of Permissions (Servers): If you’re on a multiplayer server, you cannot use this command unless you are an Operator (OP). You need the administrator to type
/op [YourName]in the server console to be able to execute gamerules. - Extra Spaces: Make sure there are no spaces at the beginning of the command (before the slash
/). - Syntax Error: Remember,
/gamerule keepInventory true. If you typeenableoronat the end, it won’t work. It must betrue.
Don’t be afraid to use the command to keep your inventory if it means you’ll enjoy building, exploring, and fighting more. Minecraft is about creativity, not about suffering while recovering lost items.