You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== set_gamerule ==
[[../objects/ms.lang.FormatException|ms.lang.FormatException]]
[[../objects/ms.lang.CastException|ms.lang.CastException]] |- ! scope="row" | Since | 3.3.1 |- ! scope="row" | Restricted |
Sets the value of the gamerule for the specified world. If world is not given the value is set for all worlds. Returns true if successful.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| set_gamerule
|-
! scope="row" | Returns
| boolean
|-
! scope="row" | Usages
| [world], gameRule, value
|-
! scope="row" | Throws
| [[../objects/com.commandhelper.InvalidWorldException|com.commandhelper.InvalidWorldException]][[../objects/ms.lang.FormatException|ms.lang.FormatException]]
[[../objects/ms.lang.CastException|ms.lang.CastException]] |- ! scope="row" | Since | 3.3.1 |- ! scope="row" | Restricted |
Yes
|-
! scope="row" | Optimizations
| None
|}The gameRule can be allowEnteringNetherUsingPortals, allowFireTicksAwayFromPlayer, announceAdvancements, blockExplosionDropDecay, commandBlockOutput, commandBlocksEnabled, commandModificationBlockLimit, disableElytraMovementCheck, disablePlayerMovementCheck, disableRaids, doDaylightCycle, doEntityDrops, doFireTick, doImmediateRespawn, doInsomnia, doLimitedCrafting, doMobLoot, doMobSpawning, doPatrolSpawning, doTileDrops, doTraderSpawning, doVinesSpread, doWardenSpawning, doWeatherCycle, drowningDamage, enderPearlsVanishOnDeath, fallDamage, fireDamage, forgiveDeadPlayers, freezeDamage, globalSoundEvents, keepInventory, lavaSourceConversion, locatorBar, logAdminCommands, maxCommandChainLength, maxCommandForkCount, maxEntityCramming, minecartMaxSpeed, mobExplosionDropDecay, mobGriefing, naturalRegeneration, playersNetherPortalCreativeDelay, playersNetherPortalDefaultDelay, playersSleepingPercentage, projectilesCanBreakBlocks, pvp, randomTickSpeed, reducedDebugInfo, sendCommandFeedback, showDeathMessages, snowAccumulationHeight, spawnChunkRadius, spawnerBlocksEnabled, spawnMonsters, spawnRadius, spectatorsGenerateChunks, tntExplodes, tntExplosionDropDecay, universalAnger, or waterSourceConversion.
=== Usages ===
set_gamerule([world], gameRule, value)=== Examples === Sorry, there are no examples for this function! :(
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)