How do I enable keepInventory on my Minecraft server?
In this article
With keepInventory enabled, players keep their inventory and experience when they die, instead of dropping everything at the spot where they fell. On servers with young players, on creative servers and during building projects it saves a lot of frustration; on a hardcore survival server it takes away part of the challenge. It is a gamerule, so it is set with one command.
Which name to use? Since Java 1.21.11 (December 2025), all gamerules have new lowercase names with underscores. On Java 1.21.11 and newer, including 26.1, 26.2 and 26.3, this rule is called keep_inventory; the old name returns Incorrect argument for command there. On Java 1.21.10 or older you still use keepInventory. Bedrock uses the old name in lowercase: gamerule keepinventory true. Every gamerule with its old and new name is listed in our overview of Minecraft gamerules and commands.
From the panel console
- Go to the game panel and click your server.
- Open the Console tab.
- Type
gamerule keep_inventory trueand press Enter. - The console confirms with Game rule keep_inventory is now set to true.
Turn it off again with gamerule keep_inventory false. In-game the same command works with a slash in front, if you are OP.
Per world
Gamerules apply per world. If your server has several worlds, for example a survival world and a creative world through Multiverse, run the command in each world separately (stand in it or use the world name with a plugin that supports it). The Nether and the End belong to the same world as the Overworld on vanilla and Paper, so one command covers all three dimensions.
Per region or per player
Want keepInventory only at spawn, in a PvP arena or for a specific rank? Then a gamerule is too coarse:
- With WorldGuard you set the flag
keep-inventory allowin a region; outside it the normal rules apply. - With a permission-based plugin you give a rank the permission to keep items, for example as a donor perk.
- On Purpur you can additionally enable
keep-inventoryper world inpurpur.yml.
The downsides
- Death loses all consequence: players can jump into lava or fight the Ender Dragon without any risk. That takes away part of the game's tension.
- Experience is kept as well (the rule covers both), so enchanting becomes easier.
- Item sinks disappear: on a busy survival server, dropped items on death are one of the few ways items leave the economy.
A middle ground many servers choose: keepInventory off, but a grave plugin (for example AngelChest or Graves) that stores the items in a chest at the place of death for a set time. That still requires the walk back, but without the risk of losing everything to despawn or lava.
Checking
Type gamerule keep_inventory without a value to see the current setting. The rule is stored in the world and survives restarts and updates; a newly generated world starts with false again. Test by dying deliberately in survival with a few blocks in your inventory.
Related gamerules
immediate_respawn true(before 1.21.11:doImmediateRespawn): skips the death screen.show_death_messages false(before 1.21.11:showDeathMessages): hides death messages in chat.natural_health_regeneration(before 1.21.11:naturalRegeneration): whether health regenerates automatically.
Stuck, for example because a plugin overrides the gamerule? Open a ticket and mention which plugins you run.
Launch your server in 60 seconds on our own hardware.