
It can be frustrating when you die in Minecraft and lose valuable items. Fortunately, there are a few ways to ensure you keep your inventory items even after death, whether you’re playing in Minecraft Java or Bedrock edition. In this guide, we’ll walk you through how to enable Keep Inventory to avoid losing everything you’ve worked for, as well as how to customize it to keep only certain items for Bedrock.
Using Keep Inventory in Java Edition
If you’re playing Minecraft Java Edition, the easiest way to prevent item loss after death is by enabling the Keep Inventory game rule. To do this, follow these steps:
- Press T to open the chat window in your Minecraft world.
- Type the command: /gamerule keepInventory true
- Press Enter.

Once you’ve done this, you’ll keep all your inventory items even if you die. This is great for long exploration trips, like carrying precious Netherite blocks, as you won’t risk losing them when you fall into a hole or face a dangerous mob. However, if you’re in a world that doesn’t have cheats enabled, there’s still a solution.
To enable cheats:
- Press Escape, click on Open to LAN, toggle Allow Cheats to ON, and start the LAN world.
- Once you do this, you can enter the above command, and you’ll be able to keep your inventory items after death.
The cool thing about the keepInventory gamerule is that you get to keep all your levels as well.
How to Keep Items After Death in Bedrock Edition
In Minecraft Bedrock Edition, you can enable Keep Inventory in two ways: through the settings menu or by using a command.
Method 1: Using the Settings Menu
- Go to the Play menu and select your world.
- Click the Edit button (pencil icon).
- In the Game settings, turn Activate Cheats ON.
- Scroll down to find the Keep Inventory setting.
- Turn Keep Inventory ON.

Sadly when you activate cheats, you will lose access to achievements. Achievements are only available in worlds set to survival mode with cheats off.
Once Keep inventory is enabled, if you die, you’ll keep all your items, just like in Java. This can be especially useful for survival worlds where you often find yourself dying and losing progress, such as when digging down or exploring deep caves.
Method 2: Using a Command
Just like in Java Edition, you can also enable Keep Inventory with a command:
- Open the chat window.
- Type: /gamerule keepInventory true
- Press Enter.
This method works in both Java and Bedrock editions, as long as cheats are enabled in your world. If cheats are off, you can temporarily enable them by opening your world to LAN and allowing cheats.
How to Keep a Specific Item After Death
If you don’t want to keep your entire inventory but want to ensure specific items are never lost upon death, you can use command blocks in both Minecraft Java and Bedrock editions.
Minecraft Bedrock Edition (Exclusive Feature)
Bedrock Edition allows you to prevent specific items from dropping using the keep_on_death tag. Here’s how:
- Obtain a Command Block:
- Type the following command in the chat:
- /give @s command_block
- Configure the Command Block:
- Place the command block and right-click to open its interface.
- Enter this command:
- /give @s diamond 1 0 {“keep_on_death”:{}}
- Replace the diamond with any item you want to keep after death.

You can also execute the command above directly in chat. Once set up, any player who receives this item will keep it after dying, while other items will drop normally.
Minecraft Java Edition
In Java Edition, there’s no direct keep_on_death tag, so you need to use a data pack or a command system to restore items upon death. One way to achieve this is by using a scoreboard to track deaths and re-giving the item when a player respawns.
For a simpler method, you can use commands like:
- /gamerule keepInventory true
However, this keeps all items, not just a specific one.
If you’re running a custom multiplayer Minecraft server or using plugins, you may find mods like EssentialsX helpful for managing item persistence on death.


