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
trueorfalse(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 truePlayers keep their inventory and XP on death.
/gamerule mobGriefing falsePrevents creepers, endermen, and ghasts from modifying terrain.
/gamerule doDaylightCycle falseFreezes the time of day at whatever it’s currently set to.
/gamerule randomTickSpeed 0Disables 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 falseThis 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
| Rule | Type | Default | Description |
|---|---|---|---|
keepInventory | boolean | false | Players keep inventory and XP on death |
mobGriefing | boolean | true | Mobs can modify terrain and pick up items |
doDaylightCycle | boolean | true | Day-night cycle progresses |
doFireTick | boolean | true | Fire spreads to nearby blocks |
doMobSpawning | boolean | true | Hostile and passive mobs spawn naturally |
naturalRegeneration | boolean | true | Players regenerate health when hunger is full |
randomTickSpeed | integer | 3 | Rate of random block ticks (crop growth, etc.) |
spawnRadius | integer | 10 | Radius around world spawn where players respawn |
pvp | boolean | true | Players can damage each other |
announceAdvancements | boolean | true | Advancements 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.
