All commands
📜
Admin

/gamerule

Change how the world behaves — keep items, freeze time, and more.

Try in Simulator

At a glance

Syntax

Syntax
/gamerule <rule> [value]
commandtargetcoordsvaluerequiredoptional

See it

What it does

The world's state changes instantly

Anatomy

Every part, explained

  1. 1
    /gameruleCommandRequired

    Reads or sets a world rule.

  2. 2
    <rule>RuleRequired

    e.g. keepInventory, doDaylightCycle, mobGriefing.

  3. 3
    [value]ValueOptional

    true/false or a number. Omit to check the current value.

Your turn

Try it yourself

Playground
3 tokens · press Enter to run

Copy & paste

Examples

/gamerule keepInventory true

Keep your items when you die.

/gamerule doDaylightCycle false

Freeze the sun in place.

/gamerule randomTickSpeed 3

Control how fast crops grow.

Avoid these

Common mistakes

/gamerule keepinventory true
/gamerule keepInventory true

Rule names are case-sensitive (camelCase).

/gamerule keepInventory 1
/gamerule keepInventory true

Boolean rules want true/false, not 1/0.

Keep going

Related commands