How to Turn On Keep Inventory on a Minecraft Server (26.x)
Turn on keep inventory on a Minecraft server with /gamerule keep_inventory true (Java 26.x) or keepinventory (Bedrock), and fix "Incorrect argument" errors.
Updated Oct 3, 2026 · 4 min read
On this page
- How do I turn on keep inventory on a Minecraft server?
- Why does "gamerule keepInventory true" not work anymore?
- Other game rules that changed name
- Keep inventory on Paper and Spigot servers
- Keep inventory for some players only
- Keep inventory on a Bedrock server
- Does keep inventory keep XP too?
- Turning it on with GamezServers
- FAQ
To turn on keep inventory on a Minecraft Java server running 1.21.11 or newer, including every 26.x version, run gamerule keep_inventory true in the server console. The old keepInventory name no longer works there. On a Bedrock server, run gamerule keepinventory true. Players then keep their items and XP when they die.
How do I turn on keep inventory on a Minecraft server?
Use the command for your edition and version. Type it in the server console without a slash, or in game with a slash as an operator.
| Edition and version | Command |
|---|---|
| Java 1.21.11 and 26.x | gamerule keep_inventory true |
| Java 1.21.10 and older | gamerule keepInventory true |
| Bedrock (all current versions) | gamerule keepinventory true |
To turn it off again, use false instead of true. To check the current value, run the command without a value, for example gamerule keep_inventory.
The change saves with the world, so it stays on after restarts. You do not need to restart the server.
Why does "gamerule keepInventory true" not work anymore?
In Java Edition 1.21.11, released December 9, 2025, Mojang moved game rules into a registry and "all game rules have been renamed from their previous camel case names to namespaced IDs in snake case" (Minecraft.net, Java Edition 1.21.11). So keepInventory became minecraft:keep_inventory. Typing the old name on 1.21.11 or any 26.x server gives an "Incorrect argument for command" or "Unknown game rule" style error.
The minecraft: prefix is optional, so both of these work:
gamerule keep_inventory true
gamerule minecraft:keep_inventory true
Your existing world keeps its setting when it upgrades. Only the command name changed.
Other game rules that changed name
If you have notes, plugins or a datapack using the old names, these are the ones server owners use most:
| Old name (1.21.10 and older) | New name (1.21.11 and 26.x) |
|---|---|
keepInventory |
keep_inventory |
doDaylightCycle |
advance_time |
doWeatherCycle |
advance_weather |
doMobSpawning |
spawn_mobs |
mobGriefing |
mob_griefing |
doInsomnia (phantoms) |
spawn_phantoms |
playersSleepingPercentage |
players_sleeping_percentage |
doImmediateRespawn |
immediate_respawn |
naturalRegeneration |
natural_health_regeneration |
announceAdvancements |
show_advancement_messages |
spawnRadius |
respawn_radius |
doFireTick |
Removed, use fire_spread_radius_around_player (0 stops fire spread) |
disableRaids |
raids, with the value inverted |
The full list is in the 1.21.11 changelog linked above. Game rules on Bedrock did not change and are still lowercase, like keepinventory and dodaylightcycle.
Keep inventory on Paper and Spigot servers
On Paper, Purpur and Spigot, game rules are stored per world, and the Nether and the End count as separate worlds. If you set keep inventory only in the Overworld, players who die in the Nether still drop everything. Set it in each dimension:
execute in minecraft:overworld run gamerule keep_inventory true
execute in minecraft:the_nether run gamerule keep_inventory true
execute in minecraft:the_end run gamerule keep_inventory true
Check each one afterwards by running the same commands without true. On vanilla and Fabric servers, game rules apply to the whole world at once, so the single command is enough.
Keep inventory for some players only
The game rule is all or nothing. If you want keep inventory only for certain players, ranks or areas, use a plugin. Plugins with death handling, or a region plugin with a keep inventory flag, let you decide per permission or per region. Our best Minecraft server plugins list covers the common choices, and LuckPerms handles the permissions side.
Keep inventory on a Bedrock server
On Bedrock Dedicated Server, run this in the server console:
gamerule keepinventory true
In game, the command only works for operators in a world with cheats allowed (allow-cheats=true in server.properties). Turning cheats on disables achievements for that world, so running the command from the server console is the cleaner option. More Bedrock commands are in our Bedrock server commands list.
Does keep inventory keep XP too?
Yes. With keep inventory on, players keep both their items and their experience levels when they die, and nothing drops on the ground. Armour, the hotbar and the offhand are all kept, and Curse of Vanishing items are kept too, since the curse only triggers when items would drop.
Turning it on with GamezServers
- Java: open the Console tab and run
gamerule keep_inventory true, or add it as one of your own custom buttons so anyone with access can toggle it in one click. - Bedrock: click the Keep inventory button in the panel. It runs
gamerule keepinventory truefor you.
Need a server first? See Minecraft server hosting or Minecraft Bedrock server hosting. Setting up a group world? Our Minecraft SMP guide has the other settings friend groups usually change.
FAQ
What is the keep inventory command in Minecraft 26.3?
/gamerule keep_inventory true. Since Java 1.21.11, game rules use snake case names, so the old keepInventory no longer works.
Why does keepInventory say incorrect argument?
Your server runs Java 1.21.11 or newer, where the rule is called keep_inventory. Use the new name.
Do I need to restart the server after turning on keep inventory?
No. Game rules take effect immediately and are saved with the world.
Why do players still lose items in the Nether?
On Paper and Spigot, each dimension has its own game rules. Run the command in the Nether and the End too, using execute in.
What is the keep inventory command on Bedrock?
gamerule keepinventory true, run from the server console or by an operator in a world with cheats allowed.
Skip the setup. Your own Minecraft server.
Then $4.99/mo. Just trying it? $1.25 for 3 days