Minecraft Game Rules: Keep Inventory, Mob Griefing and Daylight

Change Minecraft Java game rules from Console. Use the right commands for your version to keep inventory, stop mob griefing or pause the day and night cycle.

Want players to keep their items after dying, or stop creepers from damaging builds? Use the gamerule command while your Minecraft Java server is running. You do not need to edit a file or restart.

Visual guide: give access in the right place. See the steps for the exact settings used by this game.

Choose the command for your version

Check your game version in Console. Minecraft 1.21.11 and newer use the names below. Minecraft 1.21.10 and older use the older names shown beside them.

Minecraft Java game rules
Goal1.21.11 and newer1.21.10 and older
Keep inventorygamerule minecraft:keep_inventory truegamerule keepInventory true
Stop mob block changesgamerule minecraft:mob_griefing falsegamerule mobGriefing false
Pause the day/night cyclegamerule minecraft:advance_time falsegamerule doDaylightCycle false

Mob griefing also controls whether mobs pick up items. Check your farms after turning it off, rather than treating it as a setting for creepers alone.

Check or undo a change

  1. Open Console and enter your chosen command without a leading slash. In game, operators use the same command with a slash.
  2. Enter the rule without its true or false value to check it. For example, gamerule minecraft:keep_inventory.
  3. To undo the change, use false for keep inventory or true for mob griefing and the daylight cycle.

A rule that is not recognized usually has the wrong name for your version. Plugins can also override game behavior. These examples are for Java Edition, not Bedrock.

On Paper, worlds and dimensions can have separate rules. Test the Nether and End too. Join the world you want to change, then enter its gamerule command in chat with a leading / as an operator. See Paper’s world and dimension notes.

Mojang’s 1.21.11 release notes cover the game rule changes. Read our command block guide for that separate rule.

Troubleshooting checks

If the result is not what you expected
What you seeWhat to check
Unknown game ruleChoose the syntax for the installed Java version. Older camelCase names and newer namespaced names differ.
A rule works in one world but not anotherCheck the world or dimension where you tested. On Paper, verify the affected worlds separately.
Was this article helpful?

Your feedback helps us improve our guides.

Written by Konnect HostingUpdated 2 min read