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

RuleDefaultWhat it does
keepInventoryfalsePlayers keep items and experience when they die. Makes the game gentler.
doImmediateRespawnfalseSkips the death screen so players respawn at once.
playersSleepingPercentage100Percentage of players who must sleep to skip the night. Lower it so a few sleepers can skip it.
announceAdvancementstrueShows advancement messages in chat. Turn off to reduce chat clutter.
showDeathMessagestrueShows who died and how.
spawnRadius10How 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

RuleDefaultWhat it does
doDaylightCycletrueTime passes. Set to false to freeze the time of day.
doWeatherCycletrueWeather changes. Set to false to freeze the current weather.
doMobSpawningtrueNatural mob spawning. Turn off for a peaceful build world.
doInsomniatruePhantoms appear if you do not sleep.
randomTickSpeed3How fast crops grow and leaves decay. Raising it speeds growth but costs performance.
doFireTicktrueFire 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

RuleDefaultWhat it does
mobGriefingtrueWhether mobs can change blocks, such as creeper explosions, endermen picking blocks and ravagers breaking things.
tntExplodestrueWhether TNT explodes.
maxEntityCramming24How many entities can crowd one block space before they take damage. A cheap way to limit farms.
universalAngerfalseAngered neutral mobs attack any nearby player.
forgiveDeadPlayerstrueNeutral 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:

  • sendCommandFeedback controls whether command results appear in chat.
  • logAdminCommands records operator commands in the server log, which is useful for accountability.
  • commandBlockOutput controls 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 maxEntityCramming and keep randomTickSpeed at 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.