How to enable keepInventory on a Minecraft server

Change the relevant world's inventory protection rule so that players retain their items upon death. The command name may look different depending on the Minecraft version.

Step by step

  1. Enter the target world with the authorized account and open the completion list after the command /gamerule.

  2. Select the inventory protection key that the version indicates. Java 1.21.11 and later uses the name format /gamerule minecraft:keep_inventory true. Example /gamerule keepInventory true in older versions.

  3. If you are using a Nether, End or separate world add-on, also check how the rule is applied in those worlds.

  4. Die and respawn in a safe place with a test account carrying junk. Test inventory and experience behavior.

Keep in mind

To turn off the rule, use false in the same command. Death and grave add-ons may change the outcome.

Source and tools