Skip to content

Class endstone::GameRule

ClassList > endstone > GameRule

Represents a game rule.

  • #include <endstone/game_rule.h>

Inherits the following classes: endstone::Registry::Type

Public Types inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
typedef Identifier< T > Id
The identifier type used to look up this object in its registry.

Public Static Attributes

Type Name
constexpr auto CommandBlockOutput = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("commandblockoutput")
Whether command blocks notify administrators when they execute commands.
constexpr auto CommandBlocksEnabled = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("commandblocksenabled")
Whether command blocks can execute commands.
constexpr auto DoDayLightCycle = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("dodaylightcycle")
Whether the day and night cycles progress.
constexpr auto DoEntityDrops = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("doentitydrops")
Whether non-mob entities drop items.
constexpr auto DoFireTick = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("dofiretick")
Whether fire spreads.
constexpr auto DoImmediateRespawn = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("doimmediaterespawn")
Whether players immediately respawn.
constexpr auto DoInsomnia = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("doinsomnia")
Whether players experience insomnia.
constexpr auto DoLimitedCrafting = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("dolimitedcrafting")
Whether players can craft only unlocked recipes.
constexpr auto DoMobLoot = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("domobloot")
Whether mobs drop loot.
constexpr auto DoMobSpawning = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("domobspawning")
Whether mobs spawn naturally.
constexpr auto DoTileDrops = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("dotiledrops")
Whether blocks drop items when destroyed.
constexpr auto DoWeatherCycle = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("doweathercycle")
Whether the weather changes naturally.
constexpr auto DrowningDamage = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("drowningdamage")
Whether entities take drowning damage.
constexpr auto FallDamage = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("falldamage")
Whether entities take fall damage.
constexpr auto FireDamage = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("firedamage")
Whether entities take fire damage.
constexpr auto FreezeDamage = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("freezedamage")
Whether entities take freezing damage.
constexpr auto FunctionCommandLimit = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("functioncommandlimit")
The maximum number of commands executed by a function per tick.
constexpr auto KeepInventory = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("keepinventory")
Whether players keep their inventory on death.
constexpr auto LocatorBar = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("locatorbar")
Whether the locator bar is displayed.
constexpr auto MaxCommandChainLength = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("maxcommandchainlength")
The maximum number of chained commands executed per tick.
constexpr auto MobGriefing = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("mobgriefing")
Whether mobs can modify the world.
constexpr auto NaturalRegeneration = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("naturalregeneration")
Whether players regenerate health naturally.
constexpr auto PlayerWaypoints = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("playerwaypoints")
Whether player waypoints are added to locator bars.
constexpr auto PlayersSleepingPercentage = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("playerssleepingpercentage")
The percentage of players that must sleep to skip the night.
constexpr auto ProjectilesCanBreakBlocks = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("projectilescanbreakblocks")
Whether projectiles can break supported blocks.
constexpr auto Pvp = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("pvp")
Whether players can damage each other.
constexpr auto RandomTickSpeed = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("randomtickspeed")
The frequency of random block ticks.
constexpr auto RecipesUnlock = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("recipesunlock")
Whether built-in recipes unlock as players progress.
constexpr auto RespawnBlocksExplode = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("respawnblocksexplode")
Whether respawn blocks explode in other dimensions.
constexpr auto SendCommandFeedback = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("sendcommandfeedback")
Whether command feedback is displayed to players.
constexpr auto ShowBorderEffect = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showbordereffect")
Whether border block effects are shown.
constexpr auto ShowCoordinates = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showcoordinates")
Whether player coordinates are displayed.
constexpr auto ShowDaysPlayed = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showdaysplayed")
Whether the number of days played is displayed.
constexpr auto ShowDeathMessages = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showdeathmessages")
Whether death messages are displayed in chat.
constexpr auto ShowRecipeMessages = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showrecipemessages")
Whether recipe unlock notifications are shown.
constexpr auto ShowTags = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("showtags")
Whether item tags are shown.
constexpr auto SpawnRadius = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**int**](classendstone_1_1Identifier.md)&gt;::minecraft("spawnradius")
The radius around world spawn in which players can spawn.
constexpr auto TntExplodes = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("tntexplodes")
Whether TNT blocks can be lit.
constexpr auto TntExplosionDropDecay = [**GameRuleId**](classendstone_1_1GameRuleId.md)&lt;[**bool**](classendstone_1_1Identifier.md)&gt;::minecraft("tntexplosiondropdecay")
Whether explosion drop decay is enabled for TNT.

Public Functions inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
virtual Id getId () const = 0
Return the identifier of this object.
virtual std::string getTranslationKey () const = 0
Get the translation key, suitable for use in a translation component.
operator Id () const
bool operator!= (const Id & other) const
bool operator!= (const T & other) const
bool operator== (const Id & other) const
bool operator== (const T & other) const
virtual ~Type () = default

Public Static Functions inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
const T * get (Id id)
Look up a registry entry by identifier.

Public Static Attributes Documentation

variable CommandBlockOutput

Whether command blocks notify administrators when they execute commands.

constexpr auto endstone::GameRule::CommandBlockOutput;


variable CommandBlocksEnabled

Whether command blocks can execute commands.

constexpr auto endstone::GameRule::CommandBlocksEnabled;


variable DoDayLightCycle

Whether the day and night cycles progress.

constexpr auto endstone::GameRule::DoDayLightCycle;


variable DoEntityDrops

Whether non-mob entities drop items.

constexpr auto endstone::GameRule::DoEntityDrops;


variable DoFireTick

Whether fire spreads.

constexpr auto endstone::GameRule::DoFireTick;


variable DoImmediateRespawn

Whether players immediately respawn.

constexpr auto endstone::GameRule::DoImmediateRespawn;


variable DoInsomnia

Whether players experience insomnia.

constexpr auto endstone::GameRule::DoInsomnia;


variable DoLimitedCrafting

Whether players can craft only unlocked recipes.

constexpr auto endstone::GameRule::DoLimitedCrafting;


variable DoMobLoot

Whether mobs drop loot.

constexpr auto endstone::GameRule::DoMobLoot;


variable DoMobSpawning

Whether mobs spawn naturally.

constexpr auto endstone::GameRule::DoMobSpawning;


variable DoTileDrops

Whether blocks drop items when destroyed.

constexpr auto endstone::GameRule::DoTileDrops;


variable DoWeatherCycle

Whether the weather changes naturally.

constexpr auto endstone::GameRule::DoWeatherCycle;


variable DrowningDamage

Whether entities take drowning damage.

constexpr auto endstone::GameRule::DrowningDamage;


variable FallDamage

Whether entities take fall damage.

constexpr auto endstone::GameRule::FallDamage;


variable FireDamage

Whether entities take fire damage.

constexpr auto endstone::GameRule::FireDamage;


variable FreezeDamage

Whether entities take freezing damage.

constexpr auto endstone::GameRule::FreezeDamage;


variable FunctionCommandLimit

The maximum number of commands executed by a function per tick.

constexpr auto endstone::GameRule::FunctionCommandLimit;


variable KeepInventory

Whether players keep their inventory on death.

constexpr auto endstone::GameRule::KeepInventory;


variable LocatorBar

Whether the locator bar is displayed.

constexpr auto endstone::GameRule::LocatorBar;


variable MaxCommandChainLength

The maximum number of chained commands executed per tick.

constexpr auto endstone::GameRule::MaxCommandChainLength;


variable MobGriefing

Whether mobs can modify the world.

constexpr auto endstone::GameRule::MobGriefing;


variable NaturalRegeneration

Whether players regenerate health naturally.

constexpr auto endstone::GameRule::NaturalRegeneration;


variable PlayerWaypoints

Whether player waypoints are added to locator bars.

constexpr auto endstone::GameRule::PlayerWaypoints;


variable PlayersSleepingPercentage

The percentage of players that must sleep to skip the night.

constexpr auto endstone::GameRule::PlayersSleepingPercentage;


variable ProjectilesCanBreakBlocks

Whether projectiles can break supported blocks.

constexpr auto endstone::GameRule::ProjectilesCanBreakBlocks;


variable Pvp

Whether players can damage each other.

constexpr auto endstone::GameRule::Pvp;


variable RandomTickSpeed

The frequency of random block ticks.

constexpr auto endstone::GameRule::RandomTickSpeed;


variable RecipesUnlock

Whether built-in recipes unlock as players progress.

constexpr auto endstone::GameRule::RecipesUnlock;


variable RespawnBlocksExplode

Whether respawn blocks explode in other dimensions.

constexpr auto endstone::GameRule::RespawnBlocksExplode;


variable SendCommandFeedback

Whether command feedback is displayed to players.

constexpr auto endstone::GameRule::SendCommandFeedback;


variable ShowBorderEffect

Whether border block effects are shown.

constexpr auto endstone::GameRule::ShowBorderEffect;


variable ShowCoordinates

Whether player coordinates are displayed.

constexpr auto endstone::GameRule::ShowCoordinates;


variable ShowDaysPlayed

Whether the number of days played is displayed.

constexpr auto endstone::GameRule::ShowDaysPlayed;


variable ShowDeathMessages

Whether death messages are displayed in chat.

constexpr auto endstone::GameRule::ShowDeathMessages;


variable ShowRecipeMessages

Whether recipe unlock notifications are shown.

constexpr auto endstone::GameRule::ShowRecipeMessages;


variable ShowTags

Whether item tags are shown.

constexpr auto endstone::GameRule::ShowTags;


variable SpawnRadius

The radius around world spawn in which players can spawn.

constexpr auto endstone::GameRule::SpawnRadius;


variable TntExplodes

Whether TNT blocks can be lit.

constexpr auto endstone::GameRule::TntExplodes;


variable TntExplosionDropDecay

Whether explosion drop decay is enabled for TNT.

constexpr auto endstone::GameRule::TntExplosionDropDecay;



The documentation for this class was generated from the following file include/endstone/game_rule.h