Lodehost logoLodehost

World and settings

Game rules for a survival server: keep inventory, sleeping, mob griefing and more

Two survival servers on the same version can feel nothing alike. On one, a death in a lava lake costs everything you carried; on the other, you respawn with a full inventory and the night passes as soon as one player lies down. The difference is a handful of game rules, and each of them changes in seconds without restarting anything.

5 min read

A row of switches for survival game rules, some on and some off
A few switches decide how forgiving a survival world is.

Game rules live in the world, not in server.properties

Game rules are settings stored inside the world itself. They take effect the moment you change them, while players stay online. server.properties works differently: the server reads that file when it starts, so its changes wait for a restart. The server.properties guide walks through that file line by line.

Compared onGame rulesserver.properties
Stored inThe worldA file next to the world
Takes effectStraight awayAfter a restart
Changed withThe gamerule command or the Game rules cardThe Settings tab or the Files tab
After a world resetBack to the defaultsUnchanged

Since 1.21.9, PvP and the spawning of monsters are game rules as well. The old pvp and spawn-monsters lines in server.properties no longer do anything on those versions.

Game rules are not the same as the rules your players agree to. No griefing, no cheating and how staff respond are written for people, not for the world file, and Minecraft server rules on astroworldmc.site has 24 examples of those to adapt.

Game rule examples: keeping inventory, mob griefing and the daylight cycle
Game rules can change inventory loss, mob damage to blocks and the day-night cycle. Illustration of examples, not the default settings. View larger.

The names changed in 1.21.11

Game rules used to be written as one word with capitals, like keepInventory. Since 1.21.11 they are lowercase words joined by underscores, and several got a name that says more plainly what they do. A current server answers an old name with the error Incorrect argument for command.

Before 1.21.11Since 1.21.11
keepInventorykeep_inventory
mobGriefingmob_griefing
doDaylightCycleadvance_time
doWeatherCycleadvance_weather
doMobSpawningspawn_mobs
doInsomniaspawn_phantoms
doPatrolSpawningspawn_patrols
naturalRegenerationnatural_health_regeneration
doImmediateRespawnimmediate_respawn
announceAdvancementsshow_advancement_messages
playersSleepingPercentageplayers_sleeping_percentage

Guides and videos from before that release still show the old names. The Game rules card in our panel checks which version your server runs and sends the name that version understands.

Changing a rule

The Game rules card sits on the World tab. It reads the current value of each rule from the running server, so start the server first. Flip a switch and the card sets that rule in the overworld, the Nether and the End in one go.

The console works just as well and reaches every rule the game has, including those the card leaves out. Without a value, the game answers with the current setting:

Console

gamerule keep_inventory
gamerule keep_inventory true
gamerule players_sleeping_percentage 50
gamerule raids false

In chat, put a slash in front. That takes operator rights, and the guide to operator levels explains which level allows what.

The rules that shape survival

RuleDefaultWhat changes when you flip it
keep_inventoryoffOn: players keep their items and experience when they die, so a death no longer means a run back to a pile of items.
mob_griefingonOff: creepers stop breaking blocks, endermen leave blocks where they are, and farmer villagers stop harvesting crops.
pvponOff: players can no longer hurt each other.
spawn_monstersonOff: no hostile mobs, while animals keep spawning.
spawn_phantomsonOff: no phantoms, however long players go without sleep.
spawn_patrolsonOff: no roaming groups of pillagers. Raids have a rule of their own, raids.
tnt_explodesonOff: lit TNT no longer explodes.
natural_health_regenerationonOff: health only comes back through potions, golden apples and similar effects.
immediate_respawnoffOn: players skip the death screen.
show_death_messagesonOff: deaths are no longer announced in chat.
locator_baronOff: the experience bar stops showing the direction of other players.
players_sleeping_percentage100The share of players online that has to sleep before the night is skipped.

How many players need to sleep

players_sleeping_percentage counts the players online. The game rounds up, never asks for fewer than one sleeper, and leaves players in spectator mode out of the count. At the default of 100 everyone has to be in bed, which on a busy server hardly ever happens.

Players onlineSleepers needed at 25At 50At 100
2112
3123
4124
6236
103510

At 0 a single player skips the night for everyone. A value around 50 tends to suit a community server: the night still passes, but not the second one person lies down while the others are halfway through a fight.

Three survival servers, three sets of rules

No single setup is right for every group. Treat these three as a starting point, change one rule at a time, and ask your players how it feels.

RuleRelaxed, among friendsClassic survivalHard going
keep_inventoryonoffoff
players_sleeping_percentage050100
spawn_phantomsoffonon
mob_griefingoffonon
immediate_respawnonoffoff
natural_health_regenerationononoff
locator_barononoff

Difficulty and hardcore mode are not game rules. The server.properties guide covers both, together with the other settings the server reads when it starts.

Rules that catch people out

  • `spawn_mobs` switches off animals too. For a world without monsters that still has cows and sheep, turn off spawn_monsters and leave spawn_mobs on.
  • `mob_griefing` also stops farms. Villager crop farms and other contraptions that rely on mobs changing blocks stand still while it is off.
  • `keep_inventory` keeps experience as well, which makes enchanting a lot easier on a server that uses it.
  • Rules belong to the world. A world reset or an uploaded world comes with its own rules, so set yours again afterwards.
  • `locator_bar` gives positions away. On a server with PvP or hide and seek, switching it off keeps everyone's direction to themselves.

For creepers, TNT and players who break what others built, the griefing guide shows where these rules fit next to protection plugins.

Written and checked by the Lodehost team, last reviewed on 14 September 2026.

FAQ

Questions about game rules

Do game rules need a server restart?

No. A game rule takes effect the moment it changes and is saved with the world, so it is still set after the next restart.

Why does gamerule keepInventory give an error?

Since 1.21.11 the rule is called keep_inventory. Current servers reject the old name with the message Incorrect argument for command.

Does keep inventory also keep experience?

Yes. Players keep both their items and their experience levels when they die.

Are game rules kept when I reset the world?

No. The rules are stored in the world, so a new world starts with the default values. Set them again once it has been generated.

How do I stop phantoms without removing other mobs?

Turn off spawn_phantoms. Phantoms then stay away whatever players' sleeping habits are, and every other mob spawns as usual.

Keep inventory on, phantoms off, and nobody has to type a command.

The Game rules card on the World tab reads each rule from the running server and changes it in all three dimensions at once.

Compare the plans