MiniBench

MiniBench / Learn / Commands

Command Bedrock Edition ~2 min read

The /gamerule command

Change the rules of your world — keep items on death, freeze time, hide command spam.

What it does

/gamerule flips the switches that govern a whole world. Keep your inventory when you die, stop the sun moving, turn off mob griefing, or show coordinates — essential setup for a map or a test world.

Syntax

gamerule <rule> [value]
rule
The rule name, e.g. keepInventory, doDaylightCycle, mobGriefing, showCoordinates.
value
true / false for most rules; a number for a few. Omit to read the current value.

Examples

gamerule keepInventory true

Keep your items when you die.

gamerule doDaylightCycle false

Freeze the time of day (set it with /time first).

gamerule showCoordinates true

Show your X Y Z on screen — handy while building.

See it in action

Before and after running /gamerule — in MiniBench's 3D preview and in Minecraft.

Command run

gamerule showcoordinates true
In Minecraft
/gamerule showcoordinates turning on the coordinate readout in Minecraft (before)

Before

/gamerule showcoordinates turning on the coordinate readout in Minecraft (after)

After

Not affiliated with Mojang or Microsoft. Minecraft is a trademark of Mojang Synergies AB.

Watch out for

Write it in MiniBench with autocomplete and live validation, then run it in Minecraft.