Command block

Minecraft Gamerule Command Generator

Gamerules are world switches, and the usual mistake is the value type: keepInventory takes true or false while randomTickSpeed takes an integer, and a mistyped rule name fails without much feedback. Pick the rule here and the generator constrains the value to what that rule accepts.

  • keepInventory, mobGriefing, doDaylightCycle, doMobSpawning and randomTickSpeed
  • Boolean and integer value handling per rule
  • Version-aware output for Java and Bedrock

FAQ

How do I keep my inventory when I die?

/gamerule keepInventory true. It takes a true/false value; typing a number instead is a common error, which is why the generator constrains the value to the type each rule expects.

How do I stop mobs from griefing the world?

/gamerule mobGriefing false stops creepers, endermen and other mobs from changing blocks. Note it also disables villager farming and some other block interactions.

Why does my randomTickSpeed change nothing visible?

randomTickSpeed takes an integer, not true/false, and controls crop growth, fire spread and leaf decay. Very high values can lag the world; keep it modest unless you are testing.