Gamerule Command Generator — /gamerule Boolean and Integer Rules (Java Edition)
Most of these need operator permission — run them from an op's chat, a command block, or the server console.
How to Use the Gamerule Command Generator
- Choose a rule from the list – each one is either a boolean (true/false) or an integer rule, and the input field automatically switches to match.
- For boolean rules, pick
trueorfalse. For integer rules, enter a whole number. - Copy the generated
/gamerulecommand into a command block, the console, or an operator’s chat.
Command Syntax Reference
/gamerule <rule> <value> /gamerule <rule>
Every gamerule takes a single value matching its type – boolean rules like keepInventory, mobGriefing, and doDaylightCycle accept only true/false, while integer rules like randomTickSpeed and maxCommandChainLength accept a whole number. Running /gamerule <rule> with no value doesn’t change anything – it just reports the rule’s current setting. Gamerules apply world-wide; there’s no per-player targeting, unlike most other commands on this page.
Frequently Asked Questions
Do gamerule changes apply to the whole world, or just one player?
The whole world – gamerules are global settings with no target selector option. Turning off mobGriefing, for example, stops all mobs from griefing for every player on the server, not just the executor.
Does keepInventory also keep experience on death?
Yes – when keepInventory is set to true, both the inventory contents and accumulated experience are preserved through death, instead of items dropping and XP scattering as orbs.
What exactly does mobGriefing control?
It’s broader than the name suggests – beyond creepers/endermen/etc. changing terrain, mobGriefing also gates things like villagers picking up items, zombies breaking down doors, and endermen picking up blocks. Turning it off disables all of these at once, not just explosion damage.
Are gamerule changes saved permanently, or do they reset on restart?
They’re saved with the world – a gamerule change persists across server restarts and reloads exactly like any other world setting, until it’s explicitly changed again with another /gamerule command.
Related Tools
- Difficulty Command Generator – adjust world difficulty alongside gamerules for a full setup.
- Time Command Generator – control the day/night cycle directly, separate from the doDaylightCycle rule.
- Weather Command Generator – force weather instead of relying on natural cycles.