Dying in Minecraft and losing all your hard-earned diamond gear, tools, and resources can be heartbreaking. Fortunately, you can easily prevent this by enabling the Keep Inventory game rule, allowing you to keep all items and experience points whenever your character dies.
Enabling keepInventory does not disable Xbox achievements or PlayStation trophies in modern Bedrock Edition worlds as long as you are playing on a world that allows them.
If you play in Hardcore mode, keep inventory cannot be enabled because permadeath is a core mechanic of that mode.
Ensure Cheats Are Enabled
To change the keep inventory setting using commands, your world must have cheats turned on. If you are creating a new world, look for the Allow Cheats or Cheats toggle in your world creation settings and make sure it is switched on.
If you are playing on an existing Java Edition world without cheats, press the Esc key, click Open to LAN, select Allow Cheats: ON, and click Start LAN World to temporarily enable them.
Open the In-Game Chat Box
Next, you need to open your chat window to type the command. Press the T key on PC, tap the chat icon on mobile devices, or press the appropriate chat button on your controller to bring up the text input line.
Type the Keep Inventory Command
Type the exact command /gamerule keepInventory true into the chat box. This command tells the game to update your world rules so that items stay in your inventory upon death.
Make sure you capitalize the capital I in keepInventory exactly as shown, or the command may not recognize the rule.
Press Enter to Apply the Setting
Press the Enter key or tap the submit button to run the command. You will see a confirmation message appear in the chat window stating that the game rule keepInventory has been updated to true.
For players using Bedrock Edition on consoles or mobile, you can also toggle this setting directly from the Game Settings menu under the World Options section without typing any commands.
Frequently Asked Questions
Will turning on keep inventory disable achievements?
In modern Minecraft Bedrock Edition, changing game rules like keep inventory no longer disables achievements on standard survival worlds.
How do I turn keep inventory off again?
Simply open your chat box and type /gamerule keepInventory false and press enter to revert the setting back to normal.









