How to Change Game Rules on a Minecraft Server (Java 26.x List)

Change game rules on a Minecraft Java server with /gamerule: the 26.x snake case names, defaults, one player sleep, mob griefing, and per world rules on Paper.

Updated Oct 8, 2026 · 6 min read

On this page

To change a game rule on a Minecraft Java server, type gamerule <rule> <value> in the server console, for example gamerule players_sleeping_percentage 0 or gamerule mob_griefing false. The change works instantly, needs no restart and is saved in the world. Since Java 1.21.11 every rule uses a snake case name, so old commands like gamerule doDaylightCycle false fail on 26.x servers. Below is how the command works, the rules server owners change most with their defaults, and the Paper trap that catches people out.

For Bedrock Dedicated Server, see how to change game rules on a Bedrock server instead. Bedrock still uses lowercase names like keepinventory.

How do I use the gamerule command?

There are three forms:

What you want Console command
Change a rule gamerule mob_griefing false
Check a rule's current value gamerule mob_griefing
Use the full name gamerule minecraft:mob_griefing false

In game, add a slash and you must be an operator at level 2 or higher. In the console, no slash and no permission needed. Values are true and false for switches, or a whole number for rules like random_tick_speed.

Game rules live inside the world, not in server.properties. That has two consequences:

  1. They survive restarts with no file editing.
  2. If you swap to a new world folder, it starts with default rules again. Set them again after a world reset.

The game rules server owners change most

Names are for Java 1.21.11 and every 26.x release. The old name is listed so you can translate commands from older guides and videos.

Rule (26.x) Old name Default What it does
keep_inventory keepInventory false Players keep items and XP on death
players_sleeping_percentage playersSleepingPercentage 100 Percent of players who must sleep to skip the night. 0 or 1 means one player is enough
mob_griefing mobGriefing true Creepers blow up blocks, endermen take blocks, villagers farm. false stops all of it
advance_time doDaylightCycle true false freezes the time of day
advance_weather doWeatherCycle true false freezes the weather
spawn_phantoms doInsomnia true false stops phantoms spawning for players who do not sleep
spawn_mobs doMobSpawning true false stops natural mob spawning
immediate_respawn doImmediateRespawn false Skips the death screen
natural_health_regeneration naturalRegeneration true Health comes back from a full hunger bar
show_death_messages showDeathMessages true Death messages in chat
show_advancement_messages announceAdvancements true Advancement messages in chat
respawn_radius spawnRadius 10 How far from world spawn new players land. 0 puts them on the exact spot
random_tick_speed randomTickSpeed 3 Crop, tree and grass growth speed. Raising it costs CPU
fall_damage fallDamage true Fall damage on or off
tnt_explodes tntExplodes true false makes TNT harmless
raids disableRaids (inverted) true false turns raids off
send_command_feedback sendCommandFeedback true Command replies in chat
command_block_output commandBlockOutput true Command blocks announce what they ran
max_entity_cramming maxEntityCramming 24 Mobs in one block before they take damage

Four rules replaced lines that used to be in server.properties in 1.21.9, and people still look for them in the file:

Rule (26.x) Replaced Default
pvp pvp= in server.properties true
spawn_monsters spawn-monsters= true
allow_entering_nether_using_portals allow-nether= true
command_blocks_work enable-command-block= true in new worlds

Fire spread changed too: doFireTick is gone and the closest replacement is fire_spread_radius_around_player, where 0 stops fire spreading. The full rename list is in Mojang's Java Edition 1.21.11 changelog.

One player sleep. The most asked for change on friend servers:

gamerule players_sleeping_percentage 0

Any single player in bed skips the night. 50 means half the players online.

Stop creeper damage but keep creepers. Turn off griefing:

gamerule mob_griefing false

This also stops villagers farming and sheep eating grass, and snow golems leave no trail. If you only want creepers tamed, use a plugin or data pack that handles explosions instead.

Permanent day for a build server.

time set day
gamerule advance_time false
gamerule advance_weather false
weather clear

Keep inventory. gamerule keep_inventory true. More detail, including Bedrock, in how to turn on keep inventory.

No PvP. gamerule pvp false. For safe zones or opt in fights, see how to turn off PvP on a Minecraft server.

The Paper trap: rules are per world

On Paper, Purpur and Spigot every dimension is its own world with its own game rules. Running gamerule keep_inventory true from the console only changes the Overworld, so players who die in the Nether still drop everything. Set the rule 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

The same applies to extra worlds made with Multiverse. Each one keeps its own rules, so set them per world or use Multiverse's own commands. On vanilla, Fabric, Forge and NeoForge, one command covers the whole save.

Why does my gamerule command not work?

Message or symptom Cause Fix
"Incorrect argument for command" You used an old camel case name on 1.21.11 or newer Use the snake case name from the table
"Unknown or incomplete command" Missing value or typo Check spelling. Run it with no value to see the current setting
"You do not have permission" You are not an operator Run it in the console, or op yourself
Works in the Overworld only Paper per world rules Use execute in for each dimension
Rule reset after a restart You started a new world, or a plugin sets it Check level-name and your plugins' configs
A data pack or plugin uses the old name It was written for 1.21.10 or older Update it, or ask the author

On older servers (1.21.10 and below), the camel case names are correct and the snake case ones will not work. Check your version with version on Paper, or in the server log on vanilla.

Changing game rules on GamezServers

On a GamezServers Minecraft server, open the Console tab and type the command without a slash. Rules you change often, like one player sleep, can be saved as your own custom button so friends with panel access can flip them in one click. Since rules are stored in the world, they come along when you download, back up or move the server. Running an SMP? The Minecraft SMP hosting page and the SMP setup guide list the rules groups usually change on day one.

FAQ

What is the one player sleep command in Minecraft 26.x?

/gamerule players_sleeping_percentage 0. On 1.21.10 and older it is /gamerule playersSleepingPercentage 0.

Do game rules reset when the server restarts?

No. They are saved in the world's level.dat. They only reset if the server loads a different world.

Can I change game rules in server.properties?

No. Game rules are not in server.properties. Use the gamerule command in the console. Since 1.21.9, pvp, allow-nether, spawn-monsters and enable-command-block moved from the file into game rules.

How do I see all game rules?

Type gamerule in game and press Tab to scroll through every rule name your version supports. The Minecraft Wiki also keeps a full table with defaults.

Why does keep inventory not work in the Nether?

On Paper, Purpur and Spigot each dimension has its own rules. Run the command with execute in minecraft:the_nether run in front of it, and the same for the End.

Skip the setup. Your own Minecraft server.

$2.49USD first month

Then $4.99/mo. Just trying it? $1.25 for 3 days

Keep reading