Minecraft Gamerules: keep_inventory and the Rules Servers Ask for Most
Game rules (gamerules) decide things like whether you lose your inventory when you die, whether creepers break blocks or how many players have to sleep to skip the night. Since Minecraft 1.21.11 they all have different names: that's why “gamerule keepInventory true” no longer does anything on an up-to-date server. Here are today's names and the ones people use most with friends.
How to change a rule
In the panel, open your server, go to “Console” and type the command without a slash: gamerule keep_inventory true. It also works from the in-game chat, with a slash (/gamerule keep_inventory true), if you're an operator (the admin commands guide explains how to make yourself op).
Watch out on Paper: each world keeps its own rules, and the console only changes the ones in the main world. For the Nether and the End, use the same command with execute in front: execute in minecraft:the_nether run gamerule keep_inventory true, and the same with minecraft:the_end. On NapNodes you can skip that: “Settings” → “Game rules” changes them in all three at once, no commands needed (with the server running).
The change takes effect immediately, no restart needed. If you type the rule without a value (gamerule keep_inventory), the server tells you its current setting.
Rules are saved with the world: if you reset the world, they go back to their default values and you have to set them again.
Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.
Why keepInventory stopped working: the new names
In 1.21.11 Mojang switched every rule to lowercase with underscores and, while at it, renamed many of them. On the server we give you (Paper, on the latest version) only today's names count. The most searched ones:
keepInventory → keep_inventory · doDaylightCycle → advance_time · doWeatherCycle → advance_weather · doMobSpawning → spawn_mobs · mobGriefing → mob_griefing · doInsomnia → spawn_phantoms · naturalRegeneration → natural_health_regeneration · doImmediateRespawn → immediate_respawn · playersSleepingPercentage → players_sleeping_percentage · announceAdvancements → show_advancement_messages · showDeathMessages → show_death_messages · doMobLoot → mob_drops · doTileDrops → block_drops · doEntityDrops → entity_drops · randomTickSpeed → random_tick_speed · spawnRadius → respawn_radius · doPatrolSpawning → spawn_patrols · doTraderSpawning → spawn_wandering_traders · doWardenSpawning → spawn_wardens · doVinesSpread → spread_vines.
Careful with three that now mean the opposite: disableRaids became raids, disableElytraMovementCheck became elytra_movement_check and disablePlayerMovementCheck became player_movement_check. Before, “true” turned raids off; now raids false is what turns them off.
And two were merged into one that takes a number: doFireTick and allowFireTicksAwayFromPlayer are now fire_spread_radius_around_player, the distance in blocks around a player within which fire spreads. The default is 128; with 0 fire doesn't spread; with -1 it spreads even when nobody is nearby.
On top of that, since 1.21.9 four options moved out of server.properties and became rules: pvp, spawn_monsters, allow_entering_nether_using_portals (formerly allow-nether) and command_blocks_work (formerly enable-command-block). If your server.properties still has pvp=false, that line no longer does anything.
Full table: the old name and the new one
This is the complete list of rules from 1.21.11 onwards, taken from Paper's source code. If you're coming from an old guide or from a server on 1.21.10 or earlier, look up the old name here.
Renamed: announceAdvancements → show_advancement_messages · commandBlocksEnabled → command_blocks_work · commandModificationBlockLimit → max_block_modifications · doDaylightCycle → advance_time · doEntityDrops → entity_drops · doImmediateRespawn → immediate_respawn · doInsomnia → spawn_phantoms · doLimitedCrafting → limited_crafting · doMobLoot → mob_drops · doMobSpawning → spawn_mobs · doPatrolSpawning → spawn_patrols · doTileDrops → block_drops · doTraderSpawning → spawn_wandering_traders · doVinesSpread → spread_vines · doWardenSpawning → spawn_wardens · doWeatherCycle → advance_weather · maxCommandChainLength → max_command_sequence_length · maxCommandForkCount → max_command_forks · minecartMaxSpeed → max_minecart_speed · naturalRegeneration → natural_health_regeneration · snowAccumulationHeight → max_snow_accumulation_height · spawnerBlocksEnabled → spawner_blocks_work · spawnRadius → respawn_radius.
Now meaning the opposite (the value is inverted): disableElytraMovementCheck → elytra_movement_check · disablePlayerMovementCheck → player_movement_check · disableRaids → raids.
The two fire rules merged into one: doFireTick and allowFireTicksAwayFromPlayer → fire_spread_radius_around_player.
Only switched to lowercase with underscores: allowEnteringNetherUsingPortals, blockExplosionDropDecay, commandBlockOutput, drowningDamage, enderPearlsVanishOnDeath, fallDamage, fireDamage, forgiveDeadPlayers, freezeDamage, globalSoundEvents, keepInventory, lavaSourceConversion, locatorBar, logAdminCommands, maxEntityCramming, mobExplosionDropDecay, mobGriefing, playersNetherPortalCreativeDelay, playersNetherPortalDefaultDelay, playersSleepingPercentage, projectilesCanBreakBlocks, randomTickSpeed, reducedDebugInfo, sendCommandFeedback, showDeathMessages, spawnMonsters, spectatorsGenerateChunks, tntExplodes, tntExplosionDropDecay, universalAnger and waterSourceConversion. For example, maxEntityCramming is max_entity_cramming.
And one that no longer exists: spawnChunkRadius was removed in 1.21.9, when the game stopped having always-loaded spawn chunks. The one missing from the list, pvp, arrived in 1.21.9 with that name and hasn't changed.
The ones people ask for most on a server with friends
Keep your inventory when you die
gamerule keep_inventory true. Items and experience are kept. It's the most requested one on servers among friends and on modded ones, where losing everything hurts more.
Skip the night when just one player sleeps
gamerule players_sleeping_percentage 1. It's the percentage of online players who have to be in bed; the default is 100, meaning everyone. With 1, one player is enough.
Turn off PvP
gamerule pvp false. Players stop hurting each other; monsters still attack. PvP only in an arena, or no friendly fire within teams, in the guide to turning off PvP.
No phantoms
gamerule spawn_phantoms false. They stop spawning even if nobody sleeps for days.
Stop creepers breaking blocks
gamerule mob_griefing false. Warning: the same rule stops villagers harvesting crops and other mob actions, so it can break villager farms. If you only want to protect other players' builds, a protection plugin is better (griefers guide).
Daytime and clear weather forever
time set day and gamerule advance_time false stop the sun at daytime; weather clear and gamerule advance_weather false get rid of rain. Handy in a building world or a lobby.
Stop fire burning down the village
gamerule fire_spread_radius_around_player 0. Fire still exists, but it no longer jumps to the blocks around it.
Respawn without the death screen
gamerule immediate_respawn true.
The ones best left alone
random_tick_speed (3 by default) speeds up crops, trees and ice if you raise it, but also what the server spends on every tick. On a server with several players, high values show up as lag (lag guide).
player_movement_check and elytra_movement_check are checks against movement cheats. Turning them off helps cheaters, not your friends.
spawn_mobs false leaves the world with no new animals or monsters; it's often confused with spawn_monsters false, which only removes monsters.
spectators_generate_chunks is one you might want to set to false: that way a player in spectator mode flying far away doesn't force the server to generate new terrain.
If a rule doesn't take effect
Check the name: an error when typing the command is usually a pre-1.21.11 name. In the in-game chat, type /gamerule and a space: autocomplete shows you the names your version accepts.
Check the version: if your server runs an older version (for example, a Forge or Fabric modpack that needs an old version), the old names such as keepInventory still apply there.
Check plugins and datapacks: one of them may change the rules on startup or have its own option (for keeping inventory on death, for sleeping…). If the rule goes back to another value by itself after a restart, one of them is usually to blame.
Check the world: on Paper, a rule changed from the console applies to the main world, not the Nether or the End (nor Multiverse worlds, which have their own mv gamerule). If keep_inventory works on the surface but not in the Nether, this is why.
Bedrock players who join through Geyser follow the Java server's rules: there's nothing extra to set for them.
Frequently asked questions
Why doesn't gamerule keepInventory true work?
Because since Minecraft 1.21.11 the rule is called keep_inventory. Type gamerule keep_inventory true in the server console.
Do you have to restart the server after changing a gamerule?
No. The change applies immediately and is saved with the world.
How do I make it so only one player needs to sleep?
gamerule players_sleeping_percentage 1. The value is the percentage of online players who have to sleep; the default is 100.
How do I turn off PvP if it's no longer in server.properties?
Since 1.21.9 PvP is a game rule: gamerule pvp false in the console.
How do I stop fire spreading in Minecraft 1.21.11 or later?
doFireTick no longer exists: use gamerule fire_spread_radius_around_player 0.
Shall we set it up for you?
Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.
Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.
Free tool: Minecraft time calculator. How long a Minecraft day (and 100 days) lasts in real life, what time each tick is and the /time set for every hour, ready to copy.
Free tool: Target selector generator. @a, @p, @e or @s with type, distance, name or tag: the selector written right, what it picks in plain English and a warning if it catches too much.
Free tool: Gamerules generator. Pick the rules and copy the commands, or paste old ones (keepInventory, doFireTick…) and convert them to the 1.21.11 names.
Free tool: Minecraft XP calculator. How many experience points from one level to another, what you lose when you die and the /xp command to give levels on your server.
Free tool: /fill and /clone generator. Two corners and a block, and out comes the /fill or /clone. Over 32768 blocks, it splits it into commands that fit and do the same.
Keep reading
- Minecraft 1.21.9 to 1.21.11 on Your Server: PvP as a Game Rule, No Spawn Chunks and a Code of Conduct
What changed for servers between Minecraft 1.21.9 and 1.21.11: PvP and the Nether as rules, no spawn chunks, a code of conduct and renamed gamerules.
- Disable PvP on a Minecraft Server: Everywhere, Only in Some Areas or Between Teammates
How to turn PvP off or on in your Minecraft server: why pvp=false no longer works, the pvp game rule, zones with WorldGuard and teams without friendly fire.
- DiscordSRV: Connect Your Minecraft Server Chat to Discord, Step by Step
Connect your Minecraft server to Discord with DiscordSRV: creating the bot, the permissions it needs, the channel ID, the console and what to do if it's silent.