๐ŸŽ‰ Save 25% on your first month with code: DOOM25
How to Keep Inventory in Minecraft 2026: keep_inventory Command

How to Keep Inventory in Minecraft 2026: keep_inventory Command

How to keep inventory in Minecraft: run /gamerule keep_inventory true (Java 1.21.11+) or /gamerule keepInventory true (older / Bedrock). Updated 2026 with rename fix.

Magnus
ยท
8 min read
ยท
May 11, 2026

How to Keep Inventory in Minecraft 2026: keep_inventory Command

Enabling keep inventory in Minecraft is a one-line command: type /gamerule keep_inventory true in chat or in the server console, and every player on the server will keep their full inventory, armor, and XP levels when they die. To turn keep inventory off again, replace true with false. You need to be operator (OP) on a multiplayer server, or have cheats enabled in single-player, for the command to work.

That is the short answer. There is a catch in 2026 though: if you typed the older /gamerule keepInventory true and it suddenly stopped working, you are not crazy. Mojang renamed every Minecraft gamerule in snapshot 25w44a (the path to Java Edition 1.21.11), and keepInventory is now keep_inventory. The rest of this guide walks through the new command, the old command, the per-version cheat sheet, the full rename list for the other ~20 gamerules, and how to set keep inventory on your Minecraft server in three different ways.

Minecraft Java Edition snapshot 25w44a banner โ€” the update that renamed every gamerule

How to Enable Keep Inventory in Minecraft (the keep_inventory Command)

Open the chat (press T or /) or your server console and run the command that matches your version:

# Java Edition 1.21.11 and newer (and Bedrock Edition)
/gamerule keep_inventory true

# Java Edition 1.21.10 and older
/gamerule keepInventory true

That is the entire fix. Players will now keep every item, every piece of armor, and every XP level when they die โ€” until the next time you restart the world without keep inventory enabled, the setting persists.

If you get "Unknown or incomplete command" or a permission error, you are not OP. From an in-game chat, run /op <username> from the server console first, then re-run the command. From the server console you are always operator and the leading slash is optional (gamerule keep_inventory true works).

What Changed in Snapshot 25w44a (the 1.21.11 Rename)

In snapshot 25w44a, released by Mojang ahead of Java Edition 1.21.11, every gamerule was moved into a proper registry, the same way blocks, items, and entities are stored. As a consequence, all gamerule identifiers were converted from camelCase to snake_case resource locations. Where you used to type keepInventory, the canonical name is now minecraft:keep_inventory โ€” and the minecraft: prefix is optional, so keep_inventory works on its own.

The rename is not cosmetic. Gamerules are now first-class registry entries, which means datapacks and mods can reference them more reliably, and the in-game "Edit Game Rules" menu (the one you see when creating a new world) finally uses the same names everywhere.

The catch: the old camelCase names are being deprecated. They may still resolve in 1.21.11 for backward compatibility, but you should not rely on it. Update your scripts, your server.properties automation, your datapacks, and your admin tools to use the new names today, before a future snapshot drops the legacy aliases entirely.

Why `/gamerule keepInventory true` Stops Working

Three things can break this command after the 1.21.11 update:

  1. You typed the old name on a new version. On 1.21.11+, keepInventory may still be accepted, but a stricter snapshot or a custom server jar (Paper, Purpur, Fabric, NeoForge) might already reject it. Switch to keep_inventory.
  2. Case sensitivity. Gamerule names have always been case-sensitive in Java Edition. keepinventory (all lowercase) never worked, and keep_inventory is no exception โ€” Keep_Inventory will fail too.
  3. You are not OP. In a multiplayer world, only operators can run /gamerule. From the server console, you are always operator. From in-game chat, you need to be added with /op <username> first.

If you see the error No game rule called keepInventory is available in this world, you are almost certainly on 1.21.11 or newer and need the new snake_case name.

How to Enable Keep Inventory on a Minecraft Server

There are three places you can set this. Pick whichever fits your workflow.

1. From the in-game chat (fastest)

Open chat with T (or /), then type:

/gamerule keep_inventory true

You need to be OP. The change takes effect instantly for every player on the server, no restart needed. The setting is saved to your world data, so it persists across restarts.

2. From the server console

Open your server console โ€” through your hosting panel, an SSH session, or a screen/tmux window if you self-host โ€” and type the command without the leading slash:

gamerule keep_inventory true

This is the cleanest method for a live server because it does not require an operator account.

3. Before world generation (datapack or world defaults)

If you want keep inventory enabled the moment a new world is created, you can ship a datapack that sets gamerule defaults, or set them through the world creation screen on the host's panel. Most game-server panels (including the Pterodactyl-based panel we use at DoomHosting) expose a "create new world" flow where you can flip these flags before the world spawns for the first time.

The Full List of Renamed Gamerules in 1.21.11

You will probably want to update more than just keep inventory. Here is the rename map for the most common rules so you can do it all at once.

Old (camelCase) New (snake_case)
keepInventory keep_inventory
doDaylightCycle advance_time
doWeatherCycle advance_weather
doMobSpawning spawn_mobs
doMobLoot mob_drops
doTileDrops block_drops
doEntityDrops entity_drops
doImmediateRespawn immediate_respawn
doInsomnia spawn_phantoms
doLimitedCrafting limited_crafting
doPatrolSpawning spawn_patrols
doTraderSpawning spawn_wandering_traders
doWardenSpawning spawn_wardens
doVinesSpread spread_vines
naturalRegeneration natural_health_regeneration
announceAdvancements show_advancement_messages
commandBlocksEnabled command_blocks_work
spawnerBlocksEnabled spawner_blocks_work
disableElytraMovementCheck elytra_movement_check (value inverted)
disablePlayerMovementCheck player_movement_check (value inverted)
disableRaids raids (value inverted)
spawnRadius respawn_radius

The "value inverted" rules are the trickiest part of the rename: the old names were negative (disableRaids true meant raids were off), the new names are positive (raids true means raids are on). If you have automation that toggles these, flip the boolean when you rename.

You can prefix any of the new names with minecraft: (e.g. minecraft:keep_inventory) โ€” the prefix is optional but explicit, and using it future-proofs your scripts against any future rule with a colliding short name from a mod or datapack.

Bedrock Edition: Same Command, Slightly Different Rules

On Bedrock Edition (Pocket / Console / Windows 10), the syntax /gamerule keepinventory true has historically been accepted in lowercase as well, because Bedrock parses commands case-insensitively. Bedrock 1.21+ aligned with Java's casing conventions, and recent updates use keepinventory and keepInventory interchangeably. To keep your habits consistent across both editions, just use the canonical Java form: /gamerule keep_inventory true on 1.21.11+ Java, /gamerule keepInventory true on older Java and on Bedrock.

Per-Player Keep Inventory (Datapack Required)

Vanilla keep_inventory is server-wide: it is on for everyone, or off for everyone. If you want only a specific group of players (e.g. donors, staff, or hardcore-mode opt-ins) to keep their stuff on death, you need a datapack that listens for the death event and uses /clear + /give to selectively preserve items.

Several maintained datapacks do this:

  • Per-Player Keep Inventory โ€” adds a togglable scoreboard tag, players opt in/out themselves.
  • GameRule Plus โ€” adds per-team and per-permission gamerule overrides.

Drop the datapack into your world's datapacks/ folder, run /reload, and follow the pack's setup instructions. This works on any vanilla server from 1.16 onward, including 1.21.11+ with the new naming.

What This Means for Your Server

If you operate a Minecraft server in 2026, three things are worth doing today:

  • Audit your gamerule calls. Search your scripts, plugins, datapacks, and admin tools for any of the old camelCase names from the table above. Replace them with snake_case before you update to 1.21.11.
  • Watch for inverted booleans. disableRaids true becomes raids false, not raids true. Same for the elytra and player movement checks. Mistakes here silently flip server behaviour without an error.
  • Check your server panel. Some hosting panels expose gamerules through a UI rather than raw commands โ€” make sure the panel's labels match the new names, or you will toggle the wrong rule.

Host Your Minecraft Server with DoomHosting

If you want a Minecraft server where the gamerule menu, the panel UI, and the underlying Java version are always kept in lockstep with the latest snapshot, that is what DoomHosting's Minecraft hosting does for you. Instant setup, full console access, one-click version switching across every snapshot from 1.16 to 1.21.11+, automatic daily backups, and 24/7 support if a gamerule rename ever breaks something you did not expect.

Keep your inventory on death, keep your sanity through the rename, and let us handle the version juggling.

๐Ÿš€

Ready to get started?

Experience premium game server hosting with DoomHosting. Instant setup, 24/7 support, and 99.99% uptime guarantee.

Related Posts