How to use game rules (keepInventory and more)

Game rules are simple on and off switches that change how your world behaves, like keeping your items when you die.

The command

gamerule RuleName value

The ones people use most

  • gamerule keepInventory true keeps your items and XP when you die.
  • gamerule mobGriefing false stops creepers and endermen changing the world.
  • gamerule doDaylightCycle false locks the time of day.
  • gamerule doWeatherCycle false locks the weather.
  • gamerule doFireTick false stops fire spreading.
  • gamerule doInsomnia false stops phantoms spawning.
  • gamerule showDeathMessages false hides death messages in chat.
  • gamerule randomTickSpeed 3 controls how fast crops grow (higher is faster).

Type a rule with no value to see its current setting, for example gamerule keepInventory.

Game rules are saved with the world, so they stick around after a restart. Most take true or false, a few take a number.

Was this helpful?

Still need help? Contact support.