MinecraftMinecraftConfiguration

How to Change Game Rules in Minecraft

Learn how to change Minecraft game rules using commands, world creation settings, or the server console. Covers keepInventory, mobGriefing, doDaylightCycle, and more.

Game rules are built-in settings that let you alter how certain mechanics work in a Minecraft world. By changing them, you can disable fire spread, freeze the day-night cycle, prevent mob griefing, or let players keep their inventory after death. Rules are saved per world in the level.dat file, take effect immediately when changed, and persist across server restarts — no need to reconfigure them each session.

How Game Rules Work

Game rules apply to the world they’re set in, not the server globally. If you run multiple worlds, each has its own rule values. Rules are changed via the /gamerule command or set at world creation — they are not stored in server.properties.

  • Boolean rules accept true or false (e.g. keepInventory, mobGriefing, doDaylightCycle)
  • Integer rules accept a number (e.g. randomTickSpeed, spawnRadius)

Changes take effect immediately with no restart required.

Method 1: In-Game Commands

The most direct method works in both Java and Bedrock Edition. Open chat and run:

/gamerule <ruleName> <value>

Examples:

/gamerule keepInventory true

Players keep their inventory and XP on death.

/gamerule mobGriefing false

Prevents creepers, endermen, and ghasts from modifying terrain.

/gamerule doDaylightCycle false

Freezes the time of day at whatever it’s currently set to.

/gamerule randomTickSpeed 0

Disables random block ticks — stops crop growth, leaf decay, and fire spread.

Requirements: You must be OP on a server, or have cheats enabled in single-player (open to LAN with Allow Cheats on). Press Tab after /gamerule to autocomplete available rule names and avoid typos.

Method 2: World Creation Settings

If the world hasn’t been created yet, you can set rules before anyone plays.

Java Edition: On the Create New World screen, click More World Options then Game Rules. You’ll see toggles for most common rules including keepInventory, mobGriefing, naturalRegeneration, and doDaylightCycle. Setting them here writes the values into the world from the start.

Bedrock Edition: In the world creation menu under Game or World Options, look for toggles like Keep Inventory and Mob Griefing. Not all rules are exposed in the Bedrock UI — rules not shown here can be changed in-game with /gamerule after the world is created.

Method 3: Server Console

On a dedicated server you can run gamerule commands directly from the server console or through the Physgun Gamepanel’s Console tab — no need to be logged in as a player. Drop the leading / when running commands from the console:

gamerule keepInventory true
gamerule mobGriefing false
gamerule doFireTick false

This is useful for making rule changes during maintenance or before players connect, and works without requiring an in-game OP account.

Common Game Rules Reference

RuleTypeDefaultDescription
keepInventorybooleanfalsePlayers keep inventory and XP on death
mobGriefingbooleantrueMobs can modify terrain and pick up items
doDaylightCyclebooleantrueDay-night cycle progresses
doFireTickbooleantrueFire spreads to nearby blocks
doMobSpawningbooleantrueHostile and passive mobs spawn naturally
naturalRegenerationbooleantruePlayers regenerate health when hunger is full
randomTickSpeedinteger3Rate of random block ticks (crop growth, etc.)
spawnRadiusinteger10Radius around world spawn where players respawn
pvpbooleantruePlayers can damage each other
announceAdvancementsbooleantrueAdvancements are announced in chat

Troubleshooting

Command says I don’t have permission
You need to be OP on the server. Run op YourUsername from the server console, or use the console tab in the Physgun Gamepanel to run gamerule commands directly.

Rule change isn’t sticking
A plugin or mod may be resetting the rule. Check your plugin configs — some grief protection or world management plugins override mobGriefing and similar rules on a timer. Use the plugin’s own config to set the desired behavior instead.

Rule isn’t found (tab completion shows nothing)
Check the spelling and whether the rule exists in your Minecraft version. Some rules were added in later versions (e.g. doPatrolSpawning was added in 1.14). Refer to the Minecraft Wiki commands page for a full version-by-version list.

Reverting a rule
Use the same command with the original value. For booleans, flip true to false or vice versa. For integers, set them back to the default value listed in the table above.

minecraft game rulesgamerule command minecraftkeepInventory minecraftminecraft server settings

Ready to get started?

Deploy your server in seconds and start building your community today.