Game rule

From Minecraft Wiki
Jump to: navigation, search
"gamerule" redirects here. For the command, see Commands/gamerule.

Game rules are a set of customizable options for a specific in-game world.

Modifying game rules[edit]

The "Edit Game Rules" section of the "Create World" screen on Java Edition.

in Java Edition, game rules can be changed using toggle buttons on the "Edit Game Rules" menu built into the "Create World" screen. The game rules are split into categories named "Player", "Mobs", "Spawning", "Drops", "World updates", "Chat", and "Miscellaneous".

in Bedrock Edition, many (about half) of the game rules can be changed using toggles on the "World settings" and "Cheats" sections of the world's Game settings screen. The remainder can only be changed with commands.

When in-game, game rules can be changed using the /gamerule command, using the syntax /gamerule <rule> [<value>], where <rule> is the name of the game rule and <value> is an allowed value, which depends on the type of the game rule. The types are boolean (where the allowed values are either true or false) and integer (where any whole number is able to be entered).

List of game rules[edit]

The following is a list of game rules available in-game, their allowed values, and their availability in Java Edition, Bedrock Edition, or both.

List of game rules
Rule name Description Default value Type Availability
Java Bedrock
announceAdvancements Whether advancements should be announced in chat true Bool Yes No
commandBlocksEnabled Whether command blocks should be enabled in-game true Bool No Yes
commandBlockOutput Whether command blocks should notify admins when they perform commands true Bool Yes Yes
disableElytraMovementCheck Whether the server should skip checking player speed when the player is wearing elytra. Often helps with jittering due to lag in multiplayer. false Bool Yes No
disableRaids Whether raids are disabled. false Bool Yes No
doDaylightCycle Whether the daylight cycle and moon phases progress true Bool Yes Yes
doEntityDrops Whether entities that are not mobs should have drops true Bool Yes Yes
doFireTick Whether fire should spread and naturally extinguish true Bool Yes Yes
doInsomnia Whether phantoms can spawn in the nighttime true Bool Yes Yes
doImmediateRespawn Players respawn immediately without showing the death screen false Bool Yes Yes
doLimitedCrafting Whether players should be able to craft only those recipes that they've unlocked first false Bool Yes No
doMobLoot Whether mobs should drop items true Bool Yes Yes
doMobSpawning Whether mobs should naturally spawn. Does not affect monster spawners. true Bool Yes Yes
doPatrolSpawning Whether patrols can spawn true Bool Yes No
doTileDrops Whether blocks should have drops true Bool Yes Yes
doTraderSpawning Whether wandering traders can spawn true Bool Yes No
doWeatherCycle Whether the weather can change naturally. The /weather command can still change weather. true Bool Yes Yes
drowningDamage Whether the player should take damage when drowning true Bool Yes Yes
fallDamage Whether the player should take fall damage true Bool Yes Yes
fireDamage Whether the player should take damage in fire, lava, campfires, or on magma blocks‌[Java Edition only][1]. true Bool Yes Yes
forgiveDeadPlayers Makes angered neutral mobs stop being angry when the targeted player dies nearby true Bool Yes No
freezeDamage
[upcoming: JE 1.17 & BE 1.17]
Whether the player should take damage when inside powder snow true Bool Yes Yes
functionCommandLimit The maximum number of commands that can be executed by /function at once 10000 Int No Yes
keepInventory Whether the player should keep items and experience in their inventory after death false Bool Yes Yes
logAdminCommands Whether to log admin commands to server log true Bool Yes No
maxCommandChainLength The maximum length of a chain of commands that can be executed during one tick. Applies to command blocks and functions. 65536 Int Yes Yes
maxEntityCramming The maximum number of pushable entities a mob or player can push, before taking 3♥♥ suffocation damage per half-second. Setting to 0 or lower disables the rule. Damage affects survival-mode or adventure-mode players, and all mobs but bats. Pushable entities include non-spectator-mode players, any mob except bats, as well as boats and minecarts. 24 Int Yes No
mobGriefing Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, villagers, silverfish, snow golems, and end crystals should be able to change blocks and whether mobs can pick up items, which also disables bartering. This also affects the capability of zombie-like creatures like zombie pigmen and drowned to pathfind to turtle eggs. true Bool Yes Yes
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 Bool Yes Yes
playersSleepingPercentage
[upcoming: JE 1.17]
What percentage of players must sleep to skip the night. 100 Int Yes No
pvp Whether the player can fight with other players true Bool No Yes
randomTickSpeed How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 disables random ticks [needs in-game testing], higher numbers increase random ticks. Setting to a high integer results in high speeds of decay and growth 3[JE only]
1[BE only]
Int Yes Yes
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. false Bool Yes No
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 Bool Yes Yes
showCoordinates Whether the player's coordinates are displayed true Bool No Yes
showDeathMessages Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies. true Bool Yes Yes
spawnRadius The number of blocks outward from the world spawn coordinates that a player spawns in when first joining a server or when dying without a personal spawnpoint. 10[JE only]
5[BE only]
Int Yes Yes
spectatorsGenerateChunks Whether players in spectator mode can generate chunks true Bool Yes No
tntExplodes Whether TNT explodes after activation true Bool No Yes
universalAnger Makes angered neutral mobs attack any nearby player, not just the player that angered them. Works best if forgiveDeadPlayers is disabled. false Bool Yes No
showTags Hides the "Can place on" and "Can destroy" block lists from item lore. true Bool No Yes

Additional behavior[edit]

Dark Oak Sapling JE2 BE2.png
This section of the article is a stub. 
You can help by expanding it.

This section explains more complex behaviors of certain gamerules.

  • disableRaids
    • When true, the Bad Omen effect is not removed from a player when entering a village.
    • Stops a raid if set to true while a raid is in progress, but the existing raid mobs do not despawn.
  • doEntityDrops
  • doMobSpawning
    • Affects only natural mob spawning. Mobs from structures, spawners, and events still spawn when set to false.
  • doTileDrops
    • When false, containers still drop their contents, but not themselves.
      • Shulker boxes do not drop anything, causing the items in them to be lost.
    • When false, destroying an armor stand does not drop it nor any armor it had equipped.
    • When false, item frames still drop themselves and their items.
  • drowningDamage
    • When false, the player still loses air, but does not take damage when the air is depleted.
  • fireDamage
    • When false, the player may still be set on fire, but does not take damage when on fire.
  • keepInventory
    • When true, players also retain their experience upon death.
    • When true, health and hunger are still reset as normal upon death.
  • mobGriefing
    • When false, prevents:
      • All mobs from:
        • Trampling crops.
        • Trampling turtle eggs.
        • Picking up items.
        • Destroying and ruining your build.
      • Blazes from creating fire or lighting campfires.
      • Creepers from destroying blocks when they explode, although they still damage entities, but not as much.
      • End crystals from destroying blocks when they explode, although they still damage entities.
      • The ender dragon from destroying blocks, causing it to just fly through them instead.
      • Endermen from picking up or placing blocks.
      • Evoker from turning blue sheep red.
      • Foxes from picking sweet berries from a sweet berry bush.
      • Ghast fireballs from exploding blocks and creating fire. They still damage entities.
      • Piglins from attempting to barter by picking up dropped items; using the item on them still works.[verify]
      • Rabbits from eating carrot crops.
      • Ravagers from destroying crops and leaves.
      • Sheep from turning grass blocks into dirt, but does not prevent the regrowth of wool. They still act as if they are eating the grass and regrow their wool upon doing so, but the grass remains and the grass breaking sound does not play.
      • Silverfish from hiding in stone and destroying those blocks when hatching.
      • Snow golems from creating snow trails.
      • Villagers from farming and picking up items. However, they can still open doors and throw items.
      • The wither and its heads from destroying blocks with their explosions. Entities are still damaged, and a wither rose drops as an item.
      • Zombies from breaking doors and attacking turtle eggs.
    • Has no effect on the player.
  • playersSleepingPercentage[upcoming: JE 1.17]
    • When set to 0, night is skipped immediately without the falling asleep transition.
  • universalAnger
    • Every neutral mob that can be aggravated will target all nearby players whenever they are aggravated.
    • Bees attack all nearby players when their beehive is broken, regardless of the setting of this gamerule.[2]
      • Bees becoming angry when attacked works as expected.
  • forgiveDeadPlayers
    • Every neutral mob that can be aggravated will remain so even after the offending player dies, with the exception of Piglins when a player does not wear golden armor and Iron Golems when it is created from a village where the player is unpopular.

History[edit]

Java Edition
1.4.212w32aAdded /gamerule.
  • Added game rule doFireTick.
  • Added game rule mobGriefing.
  • Added game rule keepInventory.
  • Added game rule doMobSpawning.
  • Added game rule doMobLoot.
  • Added game rule doTileDrops.
12w38aAdded game rule commandBlockOutput.
1.6.113w23aAdded game rule naturalRegeneration.
13w24aAdded game rule doDaylightCycle.
1.814w03aAdded game rule logAdminCommands.
14w10aAdded game rule showDeathMessages.
14w17aAdded game rule randomTickSpeed.
14w26aAdded game rule sendCommandFeedback.
14w29aAdded game rule reducedDebugInfo.
Added the ability to create dummy gamerules.
1.8.1pre1Added game rule doEntityDrops.
game rule doTileDrops no longer affects entities.
1.915w37aAdded game rule spectatorsGenerateChunks.
15w51aAdded game rule spawnRadius.
16w07aAdded game rule disableElytraMovementCheck.
1.1116w38aAdded game rule doWeatherCycle.
Added game rule maxEntityCramming.
1.1217w13aAdded game rule doLimitedCrafting.
17w16bAdded game rule maxCommandChainLength.
17w18aAdded game rule announceAdvancements.
pre1Added game rule gameLoopFunction.
1.1317w45aRemoved the ability to create custom game rules.
17w49bRemoved game rule gameLoopFunction.
1.14.3pre3Added game rule disableRaids.
1.1519w36aAdded game rule doInsomnia.
Added game rule doImmediateRespawn.
Added game rule drowningDamage.
Added game rule fallDamage.
Added game rule fireDamage.
1.15.2pre1Added game rule doPatrolSpawning.
Added game rule doTraderSpawning.
1.1620w17aGamerules can now be changed upon world creation.
pre1Added game rule universalAnger.
Added game rule forgiveDeadPlayers.
Upcoming Java Edition
1.1720w48aAdded game rule freezeDamage.
20w51aAdded game rule playersSleepingPercentage.
Pocket Edition
1.0.5alpha 1.0.5.0Added /gamerule.
Added game rule drowningDamage.
Added game rule fallDamage.
Added game rule fireDamage.
Added game rule pvp.
1.1.0alpha 1.1.0.0Added game rule doDaylightCycle.
Added game rule doEntityDrops.
Added game rule doFireTick.
Added game rule doMobSpawning.
Added game rule doMobLoot.
Added game rule doTileDrops.
Added game rule doWeatherCycle.
Added game rule keepInventory.
Added game rule mobGriefing.
Bedrock Edition
1.6.0beta 1.6.0.6Added game rule doInsomnia.
1.7.0beta 1.7.0.2Added game rule commandBlocksEnabled.
1.8.0beta 1.8.0.8Added game rule randomTickSpeed.
1.9.0beta 1.9.0.0Added game rule showDeathMessages.
Added game rule immediateRespawn.
Added game rule functioncommandlimit.
1.12.0beta 1.12.0.2Added game rule spawnRadius.
Added game rule sendCommandBlockFeedback.
?Added game rule commandBlockOutput.
Added game rule maxCommandChainLength.
Added game rule naturalRegeneration.
Added game rule sendCommandFeedback.[verify]
Added game rule showCoordinates.
Added game rule tntExplodes.
1.14.0Added game rule showTags.
?Removed the ability to create dummy gamerules.
1.16.210beta 1.16.210.53Added game rule freezeDamage.

References[edit]