Minecraft gamerules explained: the ones worth knowing
Gamerules are the switches that change how the world behaves: whether you keep your items when you die, whether the sun moves, whether creepers break blocks. They are saved with each world and changed with one command. Knowing a dozen of them lets you shape a server's feel without installing anything.
How to use them
Run the command in the game as an operator, or in the server console without the slash:
/gamerule keepInventory true
/gamerule keepInventory
The first sets it. The second, with no value, tells you the current setting. Rules are either true or false, or a number. Each world has its own set, so if you have the Nether and End as separate dimensions of one world, the rules apply to all of them, but a different world folder keeps its own.
Rules for how players play
| Rule | Default | What it does |
|---|---|---|
keepInventory | false | Players keep items and experience when they die. Makes the game gentler. |
doImmediateRespawn | false | Skips the death screen so players respawn at once. |
playersSleepingPercentage | 100 | Percentage of players who must sleep to skip the night. Lower it so a few sleepers can skip it. |
announceAdvancements | true | Shows advancement messages in chat. Turn off to reduce chat clutter. |
showDeathMessages | true | Shows who died and how. |
spawnRadius | 10 | How far from the world spawn new players may appear. |
On a busy server, playersSleepingPercentage is the most loved of these. Setting it to something like 30 means a small group of sleepers can skip the night, so people are not held back by one idle player.
Rules for the world
| Rule | Default | What it does |
|---|---|---|
doDaylightCycle | true | Time passes. Set to false to freeze the time of day. |
doWeatherCycle | true | Weather changes. Set to false to freeze the current weather. |
doMobSpawning | true | Natural mob spawning. Turn off for a peaceful build world. |
doInsomnia | true | Phantoms appear if you do not sleep. |
randomTickSpeed | 3 | How fast crops grow and leaves decay. Raising it speeds growth but costs performance. |
doFireTick | true | Fire spreads and burns out. Turn off to stop fires spreading. |
Raising randomTickSpeed is a common request for faster farms. Keep it modest. High values multiply how much work the server does per tick, and can cause lag. How to fix server lag explains how to check.
Rules for protection and fairness
| Rule | Default | What it does |
|---|---|---|
mobGriefing | true | Whether mobs can change blocks, such as creeper explosions, endermen picking blocks and ravagers breaking things. |
tntExplodes | true | Whether TNT explodes. |
maxEntityCramming | 24 | How many entities can crowd one block space before they take damage. A cheap way to limit farms. |
universalAnger | false | Angered neutral mobs attack any nearby player. |
forgiveDeadPlayers | true | Neutral mobs calm down when their target dies. |
Setting mobGriefing to false protects builds from creepers and endermen, though it also stops useful behaviour such as villagers farming. Treat it as a blunt tool, and consider a protection plugin for finer control. See How to protect your builds from griefing.
Rules for command output
These tidy up chat and logs, mainly for admins:
sendCommandFeedbackcontrols whether command results appear in chat.logAdminCommandsrecords operator commands in the server log, which is useful for accountability.commandBlockOutputcontrols whether command blocks announce themselves. If you use many, turning this off prevents chat spam.
Practical recipes
- Relaxed survival:
keepInventory true,playersSleepingPercentage 30,announceAdvancements false. - Creative build world:
doDaylightCycle false,doWeatherCycle false,doMobSpawning false. - Protect spawn farms from lag: lower
maxEntityCrammingand keeprandomTickSpeedat the default.
Rules affect only the world you set them in, so after changing the world or restoring a backup, check them again. For the commands around them, see Essential Minecraft admin commands.
Still stuck? Open a ticket on Discord - run /ticket in any channel, pick a department, and include your Server ID or Invoice ID so we can jump straight in.