Skip to main content

Using Game Rules

Game rules let you tweak how your world behaves, from keeping your inventory on death to freezing the day/night cycle. They're changed with the /gamerule command and apply to the world you run them in.

Setting a Game Rule

/gamerule <rule> <value>

Most rules take true or false, while a few take a number. To check the current value of a rule, run the command without a value, e.g. /gamerule keepInventory.

Commonly Used Game Rules

RuleWhat it does
keepInventoryPlayers keep their items and XP when they die.
doDaylightCycleSet to false to freeze the time of day.
doWeatherCycleSet to false to stop weather from changing.
mobGriefingControls whether mobs can change blocks (creeper explosions, endermen, etc.).
doMobSpawningSet to false to stop natural mob spawning.
doFireTickSet to false to stop fire from spreading and burning out.
randomTickSpeedHow fast crops grow and leaves decay. Default is 3.
showDeathMessagesToggles death messages in chat.
announceAdvancementsToggles advancement announcements in chat.
tip

Game rules are per-world. If your server has multiple worlds (for example a separate creative world), run the command in each world you want to change.