Using gamerules in Minecraft
Gamerules control various aspects of the gameplay, and provide a lot of customization for server owners.
Gamerule Commands
How to Set the Value
/gamerule <rule name> <value>
How to Get the Current Value
/gamerule <rule name>
A
rule name
is the name of the specific gamerule that you would like to set, or view. A list of these can be seen below.The
value
is the value you wish to assign to a specific rule name. In the majority of cases, this is a booleantrue
orfalse
value, but can sometimes be a number.Each command must be entered into either an Admin/OP's chat in game or in the server console.
For Bedrock servers when the command is entered in the server console the "/" must be obmitted, otherwise the following error will occur:
Unknown command: /. Please check that the command exists and that you have permission to use it.
The following example uses the gamerule fallDamage in the Nodecraft server console for Java:
List of Gamerules
Rule Name | Description | Possible Values | Default Value | Java Edition | Bedrock Edition | Version Added |
---|---|---|---|---|---|---|
announceAdvancements | Whether advancements should be announced in chat | true/false | true | ✔️ | ❌ | 1.12 |
commandBlocksEnabled | Whether command blocks should be enabled in-game | true/false | true | ❌ | ✔️ | 1.7.0 |
commandBlockOutput | Whether command blocks should notify admins when they perform commands | true/false | true | ✔️ | ✔️ | 1.4.2 |
disableElytraMovementCheck | Whether the server should skip checking player speed when the player is wearing elytra | true/false | false | ✔️ | ❌ | 1.9 |
disableRaids | Whether raids are disabled or not | true/false | false | ✔️ | ❌ | 1.14.3 |
doDaylightCycle | Whether the day-night cycle and moon phases progress | true/false | true | ✔️ | ✔️ | 1.6.1 |
doEntityDrops | Whether entities that are not mobs should have drops | true/false | true | ✔️ | ✔️ | 1.8.1 |
doFireTick | Whether fire should spread and naturally extinguish | true/false | true | ✔️ | ✔️ | 1.4.2 |
doInsomnia | Whether phantoms can spawn in the nightmare | true/false | true | ✔️ | ✔️ | 1.15 |
doImmediateRespawn | Players respawn immediately without showing the death screen. (Bedrock: immediateRespawn) | true/false | false | ✔️ | ✔️ | 1.15 |
doLimitedCrafting | Whether players should only be able to craft recipes that they've unlocked first | true/false | false | ✔️ | ❌ | 1.12 |
doMobLoot | Whether mobs should drop items | true/false | true | ✔️ | ✔️ | 1.4.2 |
doMobSpawning | Whether mobs should naturally spawn | true/false | true | ✔️ | ✔️ | 1.4.2 |
doPatrolSpawning | Whether patrols can spawn | true/false | true | ✔️ | ❌ | 1.15.2 |
doTileDrops | Whether blocks should have drops | true/false | true | ✔️ | ✔️ | 1.4.2 |
doTraderSpawning | Whether wandering traders can spawn | true/false | true | ✔️ | ❌ | 1.15.2 |
doWeatherCycle | Whether the weather will change | true/false | true | ✔️ | ✔️ | 1.11 |
drowningDamage | Whether the player should take damage when drowning | true/false | true | ✔️ | ✔️ | 1.15 |
fallDamage | Whether the player should take fall damage | true/false | true/false | ✔️ | ✔️ | 1.15 |
fireDamage | Whether the player should take fire damage | true/false | true | ✔️ | ✔️ | 1.15 |
forgiveDeadPlayers | Makes angered neutral mobs stop being angry when the targeted player dies nearby. | true/false | true | ✔️ | ❌ | 1.16 |
freezeDamage | Whether the player should take damage when inside powder snow | true/false | true | ✔️ | ✔️ | 1.17 |
functionCommandLimit | The maximum number of commands that can be executed by /function at once | number | 10000 | ❌ | ✔️ | 1.9 |
keepInventory | Whether the player should keep items in their inventory after death | true/false | false | ✔️ | ✔️ | 1.4.2 |
logAdminCommands | Whether to log admin commands to server log | true/false | true | ✔️ | ❌ | 1.8 |
maxCommandChainLength | Determines the number at which the chain command block acts as a "chain" | number | 65536 | ✔️ | ✔️ | 1.12 |
maxEntityCramming | The maximum number of pushable entities another entity can try to push, before taking suffocation damage. Setting to 0 disables the rule. Affects players and mobs only (excluding bats) | number | 24 | ✔️ | ❌ | 1.11 |
mobGriefing | Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items | true/false | true | ✔️ | ✔️ | 1.4.2 |
naturalRegeneration | Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.) | true/false | true | ✔️ | ✔️ | 1.6.1 |
playersSleepingPercentage | What percentage of players must sleep to skip the night. | number | 100 | ✔️ | ❌ | 1.17 |
pvp | Whether the player can fight with other players | true/false | true | ❌ | ✔️ | 1.0.5 |
randomTickSpeed | How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks | number | 3 (JE) / 1 (BE) | ✔️ | ✔️ | 1.8 |
reducedDebugInfo | Whether the debug screen shows all or reduced information; and whether the effects of F3+B (entity hitboxes) and F3+G (chunk boundaries) are shown | true/false | false | ✔️ | ❌ | 1.8 |
sendCommandFeedback | Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text | true/false | true | ✔️ | ✔️ | 1.8 |
showCoordinates | Whether the player's coordinates are displayed | true/false | true | ❌ | ✔️ | Unknown |
showDeathMessages | Whether a message appears in chat when a player dies | true/false | true | ✔️ | ✔️ | 1.8 |
spawnRadius | The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint | number | 10 (JE) / 5 (BE) | ✔️ | ✔️ | 1.9 |
spectatorsGenerateChunks | Whether players in spectator mode can generate chunks | true/false | true | ✔️ | ❌ | 1.9 |
tntExplodes | Whether TNT will explode or not after activation | true/false | true | ❌ | ✔️ | Unknown |
universalAnger | Makes angered neutral mobs attack any nearby player, not just the player that angered them. Works best if you disable forgiveDeadPlayers. | true/false | false | ✔️ | ❌ | 1.16 |
showTags | Hides the "Can place on" and "Can destroy" block lists from item lore. | true/false | true | ❌ | ✔️ | 1.14.0 |
List accurate as of Minecraft 1.17.
Gamerules are an advanced feature of Minecraft. Invalid or misuse of gamerules can cause unpredictable or damaging behavior.
For more information about gamerules, and the effects they can have on gameplay, be sure to reference the Minecraft Gamerule Wiki.