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
| Edition | Syntax |
|---|---|
| Java | gamerule <rule> [<value>] |
| Bedrock | gamerule <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 truePlayers keep their items when they die
/gamerule mob_griefing falseStop creepers, endermen and ghasts from damaging blocks
/gamerule advance_time falseFreeze time at the current moment
Tips
- keep_inventory only affects deaths after it is set.
- send_command_feedback false hides command output from other players' chat.
- In Bedrock, many gamerules can also be toggled in world settings without cheats.
- Java renamed its rules in 1.21.11 (for example advance_time, keep_inventory, mob_griefing). Bedrock keeps the lowercase names: dodaylightcycle, keepinventory, mobgriefing.