Minecraft /gamerule command

Java EditionBedrock EditionSince Java 1.4.2 (12w32a) / Pocket 1.0.5

Quick answer: Changes world rules like mob griefing, keep inventory, fire spread and daylight cycle. Syntax: gamerule <rule> [<value>]

/gamerule toggles the fundamental rules of a world: whether creepers destroy blocks (mob_griefing), whether players keep items on death (keep_inventory), how far fire can spread around players (fire_spread_radius_around_player), the day cycle (advance_time) and dozens more. Run it with just the rule name to read the current value. Rules are saved per world.

Syntax

EditionSyntax
Javagamerule <rule> [<value>]
Bedrockgamerule <rule: BoolGameRule> [value: Boolean] OR gamerule <rule: IntGameRule> [value: int]

Targets / arguments: The whole world. Requires: Cheats enabled / operator level 2 (Java), 1 (Bedrock); some Bedrock rules work without cheats.

Examples

/gamerule keep_inventory true

Players keep their items when they die

/gamerule mob_griefing false

Stop creepers, endermen and ghasts from damaging blocks

/gamerule advance_time false

Freeze time at the current moment

Tips

Related commands

/difficulty/time/weather