Java 1.20–1.21.10, Java 1.21.11+/26.x and Bedrock - different rule names · 3 min read

Keep inventory after death: Java and Bedrock commands

Enable a rule for your edition, query its value, and test it on a small set of things. command changes future deaths: it does not return items previously lost.

LonelyCraft editors · Updated

Workshop with chests, furnaces, crafting table and lamps
Illustration: workshop with chests, furnaces, crafting table and lamps. This is an artistic scene, not a snapshot of a specific server.

Select your version line

To disable, replace true with false. command require rights; on a public server, the player does not change the general rules arbitrarily.

EditionEnableCheck
Java 1.20–1.21.10/gamerule keepInventory true/gamerule keepInventory
Java 1.21.11+ and 26.x/gamerule minecraft:keep_inventory true/gamerule minecraft:keep_inventory
Bedrock/gamerule keepinventory true/gamerule keepinventory
The rule name is determined by the server or world version
Revision scheme: The rule name is determined by the server or world version.Scroll the diagram horizontally.Open full-size diagram

Turn it on in your world

In Bedrock, open the world edit and the cheats/rules section: Keep Inventory / Save inventory. Read the achievement warning before enabling the required cheats. The command option from the table is convenient when you already have rights.

In Java, use the allowed commands of your world. In new versions, the owner's rights are located in World Options; in older releases, the command time resolution was often set via Open to LAN. Check the name of the button in your version, especially in Hardcore, where these actions are limited.

Check without valuable equipment

In a separate copy, take one block, a simple pickaxe and some experience. Make a note of your inventory contents and spawn point. Query the rule, then test the death in a secure test; the administrator can use /kill @s only for himself. After revival, compare items and experiences.

On the multi-world Paper, check the exact game area where death occurs. world Survival, arena and individual island can be controlled by different settings and plugins. The server version of command is determined by the kernel, even if you logged in with the old client through a translator.

Before the test, make sure where the character will return. Spawn Point.

If things are still missing

Check whether it was a death: the end of a mini-game or changing an inventory group may normally return other equipment. The grave and arena plugins are also capable of processing items. Tell the admin world, time, rule value and exact action.

This rule does not protect against deleting a save, throwing away an item, or stealing from a chest. To keep your data safe, you need a backup copy; keepInventory solves specific death mechanics.

A separate archive protects preservation during experiments. Copy of Java-world.

Frequently asked questions

command will bring back old things?

No. It affects future deaths rather than restoring items that have already been lost.

Why is keepInventory unknown?

Check the version: new Java uses minecraft:keep_inventory, Bedrock uses keepinventory.

Only works for one player?

This is the rule of the world. Individual exceptions are usually implemented by separate server logic.

Views: … · One view per browser per day

Was this useful?Total score: …

One reaction per browser. Click again to remove it, or choose the other reaction.

Sources and documentation

commandinventoryworld rules

Read on

Keep inventory after death: Java and Bedrock commands — Lonely Craft