Game rule

Revision as of 19:45, 24 August 2024 by Julie IS Baka (talk | contribs) (Techicly we dont know the experment will be addded in 1.21.2)
Jump to navigation Jump to search
"Gamerule" redirects here. For the command, see Commands/gamerule.
"Rules" redirects here. For rules about the Minecraft Wiki, see Minecraft Wiki:Rules.

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

Modifying game rules

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, 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 be changed only 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

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

List of game rules
Rule name Description Default value Type Category‌[JE only] Availability
Java Bedrock
announceAdvancements Whether advancements should be announced in chat. true Bool Chat Yes No
blockExplosionDropDecay
Whether block loot is dropped by all blocks (false) or randomly (true) depending on how far the block is from the center of a block explosion (e.g. clicking a bed in dimensions other than the Overworld). true Bool Drops 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 Chat Yes Yes
commandModificationBlockLimit Controls the maximum number of blocks changed when using /clone, /fill, or /fillbiome. 32768 Int Miscellaneous Yes No
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 Player Yes No
disableRaids Whether raids are disabled. false Bool Mobs Yes No
doDaylightCycle Whether the daylight cycle and moon phases progress. true Bool World Updates Yes Yes
doEntityDrops Whether entities that are not mobs should have drops. true Bool Drops Yes Yes
doFireTick Whether fire should spread and naturally extinguish. true Bool World Updates Yes Yes
doInsomnia Whether phantoms can spawn in the nighttime. true Bool Spawning Yes Yes
doImmediateRespawn Players respawn immediately without showing the death screen. false Bool Player Yes Yes
doLimitedCrafting Whether players can craft only those recipes that they have unlocked. false Bool Player Yes Yes
doMobLoot Whether mobs should drop items and experience orbs. true Bool Drops Yes Yes
doMobSpawning Whether mobs should spawn naturally, or via global spawning logic, such as for cats, phantoms, patrols, wandering traders, or zombie sieges. Does not affect special spawning attempts, like monster spawners, raids, or iron golems. true Bool Spawning Yes Yes
doPatrolSpawning Whether patrols can spawn. true Bool Spawning Yes No
doTileDrops Whether blocks should have drops. true Bool Drops Yes Yes
doTraderSpawning Whether wandering traders can spawn. true Bool Spawning Yes No
doVinesSpread Whether vines can spread to other blocks. Cave vines, weeping vines, and twisting vines are not affected. true Bool World Updates Yes No
doWeatherCycle Whether the weather can change naturally. The /weather command can still change weather. true Bool World Updates Yes Yes
doWardenSpawning Whether wardens can spawn. true Bool Spawning Yes No
drowningDamage Whether the player should take damage when drowning. true Bool Player Yes Yes
enderPearlsVanishOnDeath Controls whether thrown ender pearls vanish when the player dies. true Bool Player Yes No
fallDamage Whether the player should take fall damage. true Bool Player Yes Yes
fireDamage Whether the player should take damage in fire, lava, campfires, or on magma blocks. true Bool Player Yes Yes
forgiveDeadPlayers Makes angered neutral mobs stop being angry when the targeted player dies nearby. true Bool Mobs Yes No
freezeDamage Whether the player should take damage when inside powder snow. true Bool Player Yes Yes
globalSoundEvents Whether certain sound events are heard by all players regardless of location. true Bool Miscellaneous Yes No
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 Player Yes Yes
lavaSourceConversion Whether new sources of lava are allowed to form. false Bool World Updates Yes No
logAdminCommands Whether to log admin commands to server log. true Bool Chat 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 Miscellaneous Yes Yes
maxCommandForkCount The maximum number of forks (contexts) that can be created during one tick. Applies to command blocks and functions. 65536 Int Miscellaneous Yes No
maxEntityCramming The maximum number of pushable entities a mob or player can push, before taking 6HP♥♥♥ entity cramming 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 Mobs Yes No
minecartMaxSpeed[upcoming] The maximum speed a minecart may reach. 8 Int (max 1000) Yes
mobExplosionDropDecay Whether block loot is dropped by all blocks (false) or randomly (true) depending on how far the block is from the center of a mob explosion (e.g. Creeper explosion). true Bool Drops Yes No
mobGriefing Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, villagers, silverfish, snow golems, and end crystals[BE only] should be able to change blocks, and whether mobs can pick up items. When mobGriefing is disabled, piglins do not pick up gold ingots, but a player can still barter with them by using the item on the mob. Similarly, villagers do not pick up food items but can still breed until they run out of any food already in their inventory. This also affects the capability of zombie-like creatures like zombified piglins and drowned to pathfind to turtle eggs. true Bool Mobs 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 Player Yes Yes
playersNetherPortalCreativeDelay Controls the time that a creative player needs to stand in a nether portal before changing dimensions. 1 Int Player Yes No
playersNetherPortalDefaultDelay Controls the time that a non-creative player needs to stand in a nether portal before changing dimensions. 80 Int Player Yes No
playersSleepingPercentage What percentage of players in the Overworld must sleep to skip the night. A percentage value of 0 or less allows the night to be skipped by just 1 player, and a percentage value more than 100 prevents players from skipping the night. 100 Int Player Yes Yes
projectilesCanBreakBlocks Whether impact projectiles destroy blocks that are destructible by them, i.e. chorus flowers, pointed dripstone, and decorated pots. true Bool Drops Yes Yes
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 and negative values disables random ticks, higher numbers increase random ticks. Setting to a high integer results in high speeds of decay and growth. Numbers over 4096 make plant growth or leaf decay instantaneous. 3[JE only]
1[BE only]
Int World Updates Yes Yes
recipesUnlock Whether the player needs to collect items to unlock recipes in the recipe book. true Bool No 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 Miscellaneous Yes No
respawnBlocksExplode Prevents beds/respawn anchors from exploding in other dimensions. true Bool No Yes
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 Chat Yes Yes
showBorderEffect Whether border blocks effects are shown. true Bool No Yes
showCoordinates Whether the player's coordinates are displayed. true Bool No Yes
showDaysPlayed Whether a text box similar to the coordinates box (from showCoordinates) should be displayed (underneath the coordinates box). false 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 Chat Yes Yes
showRecipeMessages Whether the recipe toasts are displayed. true Bool No Yes
showTags Hides the "Can place on" and "Can destroy" block lists from item lore, as well as item lock indicators. true Bool No Yes
snowAccumulationHeight The maximum number of snow layers that can be accumulated on each block. 1 Int World Updates Yes No
spawnChunkRadius The size of the spawn chunks of the world. 2 Int Miscellaneous Yes No
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. Has no effect on servers where the default game mode is Adventure. 10 Int Player Yes Yes
spectatorsGenerateChunks Whether players in Spectator mode can generate chunks. true Bool Player Yes No
tntExplodes Whether TNT explodes after activation. true Bool No Yes
tntExplosionDropDecay Whether block loot is dropped by all blocks (false) or randomly (true) depending on how far the block is from the center of a TNT explosion. false Bool Drops Yes 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 Mobs Yes No
waterSourceConversion Whether new sources of water are allowed to form. true Bool World Updates Yes No

Additional behavior

This section needs expansion.
 
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
    • When false, removing items from item frames does not drop that item.
  • doMobLoot
  • doMobSpawning
    • Affects only natural mob spawning. Mobs from structures,‌[Java Edition only] monster 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.
    • When false, infested blocks do not spawn silverfish when broken.
  • 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.
  • forgiveDeadPlayers
    • Every neutral mob that can be aggravated remain aggravated 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.
  • keepInventory
    • When true, players also retain their experience upon death.
    • When true, health and hunger are still reset as normal upon death.
    • When true, all effects are still removed upon death.[3]
    • When true, items enchanted with Curse of Vanishing do not disappear upon death.[4]
  • mobGriefing
    • When false, prevents all mobs from modifying the environment in any way. This includes trampling crops and turtle eggs, picking up items, destroying blocks, or moving blocks. Specifically, it prevents:
      • Allays from picking up dropped items.
      • Blazes from creating fire or lighting campfires.
      • Creepers from destroying blocks when they explode, although they still damage entities.
      • Dolphins from picking up dropped items.‌[JE only]
      • End crystals from destroying blocks when they explode, although they still damage entities.
      • Ender dragons from destroying blocks, causing it to just fly through them instead.
      • Endermen from picking up or placing blocks.
      • Evoker from turning blue sheep red.‌[JE only]
      • Foxes from picking sweet berries from a sweet berry bush and picking up dropped items.
      • 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.
      • 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 infested blocks 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.
      • Withers 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, picking up items, and attacking turtle eggs.
    • Also efects mobs with the weaving effect from placing cobwebs.
    • Has no effect on mobs destroying anything in item form, ex: item frames and leads[5][until JE 1.21.2]. Also doesn't effect bees breezes, frogs turtles or the player.
  • playersSleepingPercentage
    • When set to 0, at least one player is still required to sleep to skip the night.
    • When set to a number greater than 100, night is not skipped no matter how many players are sleeping.
  • randomTickSpeed
  • snowAccumulationHeight
    • When set to 0, snow layers do not form at all.
    • When set to 8 or higher, snow forms up to the level of a full block, but no greater than that.
  • universalAnger
    • Every neutral mob that can be aggravated targets all nearby players whenever they are aggravated.
    • Bees attack all nearby players when their beehive is broken, regardless of the setting of this gamerule.[8]
      • Bees becoming angry when attacked works as expected.

History

[hide]Java Edition
1.4.212w32aAdded /gamerule.
Added the following gamerules:
  • doFireTick
  • mobGriefing
  • keepInventory
  • doMobSpawning
  • doMobLoot
  • 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 game rules.
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. Its functionality was replaced with and expanded by the minecraft:tick function tag.
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.1620w17aGame rules can now be changed upon world creation.
1.16pre1Added game rule universalAnger.
Added game rule forgiveDeadPlayers.
1.1720w48aAdded game rule freezeDamage.
20w51aAdded game rule playersSleepingPercentage.
1.1922w16aAdded game rule doWardenSpawning.
1.19.322w44aAdded the following game rules:
  • blockExplosionDropDecay
  • mobExplosionDropDecay
  • tntExplosionDropDecay
  • snowAccumulationHeight
  • waterSourceConversion
  • lavaSourceConversion
  • globalSoundEvents
1.19.423w03aAdded game rule commandModificationBlockLimit.
23w06aAdded game rule doVinesSpread.
1.20.223w31aThe randomTickSpeed game rule now affects the formation of snow and ice,[9] as well as the filling of cauldrons with rain.[10]
pre1Added game rule enderPearlsVanishOnDeath.
1.20.323w41aAdded game rule maxCommandForkCount.
23w42aAdded game rules projectilesCanBreakBlocks, playersNetherPortalDefaultDelay and playersNetherPortalCreativeDelay.
1.20.524w03aAdded game rule spawnChunkRadius.
1.2124w21aAdded game rule entitiesWithPassengersCanUsePortals.
pre1Removed game rule entitiesWithPassengersCanUsePortals. Entities with passengers can now use portals by default.
[hide]Upcoming Java Edition
1.21.2
Experiment
Minecart Improvements
24w33aAdded minecartMaxSpeed with a default of 8 and maximum of 1000.
[hide]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.
[hide]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.
1.17.30beta 1.17.20.20Added game rule respawnBlocksExplode.
?Added game rule showBorderEffect.
1.20.30Preview 1.20.20.21Added game rule playersSleepingPercentage.
Added game rule recipesUnlock.
Preview 1.20.30.20Added game rule doLimitedCrafting.
Preview 1.20.30.22The recipesUnlock game rule is now set to true by default.
1.20.40Preview 1.20.40.22The spawnRadius game rule is now set to 10 by default to match Java Edition.
1.20.50Preview 1.20.50.20Added game rule showRecipeMessages.
Preview 1.20.50.22Added game rule projectilesCanBreakBlocks.
1.21.0Preview 1.21.0.20Added game rule tntExplosionDropDecay.
Preview 1.21.0.23Added game rule showDaysPlayed.

Gallery

Screenshots

References

  1. MC-154922
  2. MCPE-73842
  3. MC-67352 — resolved as "Works As Intended".
  4. MC-108353 — resolved as "Works As Intended".
  5. MC-3697
  6. MC-249308
  7. MC-261250 — resolved as "Invalid".
  8. "Revamped anger management for neutral mobs in minecraft. Now angered neutral mobs won't attack innocent bystanders, won't forget you just cuz you log out & log in, and won't keep killing you after you die & respawn. Etc. Find anything wonky? Report at bugs.mojang.com"@henrikkniberg on X (formerly Twitter), June 5, 2020
  9. MC-93320 — Water freezes even if randomTickSpeed is 0 — resolved as "Fixed".
  10. MC-93820 — Rain filling cauldrons is not affected by randomTickSpeed — resolved as "Fixed".

Navigation