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.

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.

Keep items and experience after death: use gamerule minecraft:keep_inventory true. On older versions, use gamerule keepInventory true.

Stop mobs from changing blocks: use gamerule minecraft:mob_griefing false. On older versions, use gamerule mobGriefing false.

Pause the day and night cycle: use gamerule minecraft:advance_time false. On older versions, use gamerule 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.

Was this article helpful?

Your feedback helps us improve our guides.

Written by Konnect HostingUpdated Compare Minecraft server hosting plans →
NEED MORE HELP?

Talk with the Konnect community

Get support from staff and other server owners.

Join our Discord