Direct answer

On Java 1.21.11 and 26.x, run /gamerule keep_inventory true as an operator. On Java 1.21.10 and earlier, use /gamerule keepInventory true. No world-file editing is needed.

Recommended procedure

  1. Confirm your Minecraft Java version and use an operator account or the server console.
  2. Run /gamerule keep_inventory true (newer Java) or /gamerule keepInventory true (older Java). In the server console, omit the leading slash.
  3. Query the value with /gamerule keep_inventory or the matching legacy name.
  4. Turn it off by replacing true with false.

Why this matters

This gamerule changes what happens to players’ inventory and experience when they die; it does not restore items already lost. Check whether a multiverse or gameplay plugin overrides rules in specific worlds.

How to verify the result

Confirm the game rule reports true. On a test world with a backup, check death behavior using a non-OP player; plugins can override the vanilla result.

Version and compatibility notes

Mojang renamed Java game rules to snake-case resource identifiers in Java 1.21.11. Names and behavior differ between Java and Bedrock; this article covers Java servers. Do not blindly reuse commands from older tutorials.

Official references

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000