Class GameRules
- java.lang.Object
-
- org.spongepowered.api.world.gamerule.GameRules
-
public final class GameRules extends Object
An enumeration of all the possible game rules in vanilla minecraft.
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultedRegistryReference<GameRule<Boolean>>
ANNOUNCE_ADVANCEMENTS
If advancements should be announced to the server.static DefaultedRegistryReference<GameRule<Boolean>>
COMMAND_BLOCK_OUTPUT
WhetherCommandBlock
s should notify admins when they perform commands.static DefaultedRegistryReference<GameRule<Boolean>>
DISABLE_ELYTRA_MOVEMENT_CHECK
Whether the server should skip checking player speed when the player is wearing elytra.static DefaultedRegistryReference<GameRule<Boolean>>
DISABLE_RAIDS
WhetherRaid
s are disabled.static DefaultedRegistryReference<GameRule<Boolean>>
DO_DAYLIGHT_CYCLE
Whether the day-night cycle and moon phases progress.static DefaultedRegistryReference<GameRule<Boolean>>
DO_ENTITY_DROPS
Whether entities that are not mobs should have drops.static DefaultedRegistryReference<GameRule<Boolean>>
DO_FIRE_TICK
Whether fire should spread and naturally extinguish.static DefaultedRegistryReference<GameRule<Boolean>>
DO_IMMEDIATE_RESPAWN
WhetherPlayer
s should respawn immediately without showing the death screen.static DefaultedRegistryReference<GameRule<Boolean>>
DO_INSOMNIA
WhetherPhantom
s can spawn in the night-time.static DefaultedRegistryReference<GameRule<Boolean>>
DO_LIMITED_CRAFTING
WhetherPlayer
s can only craft recipes they have unlocked.static DefaultedRegistryReference<GameRule<Boolean>>
DO_MOB_LOOT
WhetherAgent
s should drop items.static DefaultedRegistryReference<GameRule<Boolean>>
DO_MOB_SPAWNING
WhetherAgent
s should naturally spawn.static DefaultedRegistryReference<GameRule<Boolean>>
DO_PATROL_SPAWNING
Whetherpatrollers
will go out on patrol (typically in aRaid
.static DefaultedRegistryReference<GameRule<Boolean>>
DO_TILE_DROPS
Whether blocks should have drops.static DefaultedRegistryReference<GameRule<Boolean>>
DO_TRADER_SPAWNING
Whethertraders
will naturally spawn.static DefaultedRegistryReference<GameRule<Boolean>>
DO_WEATHER_CYCLE
Whether the weather will change.static DefaultedRegistryReference<GameRule<Boolean>>
DROWNING_DAMAGE
Whether entities should take drowning damage.static DefaultedRegistryReference<GameRule<Boolean>>
FALL_DAMAGE
Whether entities should take fall damage.static DefaultedRegistryReference<GameRule<Boolean>>
FIRE_DAMAGE
Whether entities should take fire damage.static DefaultedRegistryReference<GameRule<Boolean>>
FORGIVE_DEAD_PLAYERS
Makes angered neutral mobs stop being angry when the targeted player dies nearby.static DefaultedRegistryReference<GameRule<Boolean>>
KEEP_INVENTORY
WhetherPlayer
s should keep items in their inventory after death.static DefaultedRegistryReference<GameRule<Boolean>>
LOG_ADMIN_COMMANDS
Whether to log admin commands to server log.static DefaultedRegistryReference<GameRule<Integer>>
MAX_COMMAND_CHAIN_LENGTH
The total number ofchain command blocks
that can run during a single tick.static DefaultedRegistryReference<GameRule<Integer>>
MAX_ENTITY_CRAMMING
The maximum number of other pushable entities a mob or player can push, before taking 3 suffocation damage per half-second.static DefaultedRegistryReference<GameRule<Boolean>>
MOB_GRIEFING
static DefaultedRegistryReference<GameRule<Boolean>>
NATURAL_REGENERATION
WhetherPlayer
s can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.).static DefaultedRegistryReference<GameRule<Integer>>
RANDOM_TICK_SPEED
How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick.static DefaultedRegistryReference<GameRule<Boolean>>
REDUCED_DEBUG_INFO
Whether the debug screen shows all or reduced information.static DefaultedRegistryReference<GameRule<Boolean>>
SEND_COMMAND_FEEDBACK
Whether the feedback from commands executed by aPlayer
should show up in chat.static DefaultedRegistryReference<GameRule<Boolean>>
SHOW_DEATH_MESSAGES
Whether a message appears in chat when aPlayer
dies.static DefaultedRegistryReference<GameRule<Integer>>
SPAWN_RADIUS
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 spawn point.static DefaultedRegistryReference<GameRule<Boolean>>
SPECTATORS_GENERATE_CHUNKS
Whether players inspectator mode
can generate chunks.static DefaultedRegistryReference<GameRule<Boolean>>
UNIVERSAL_ANGER
Makes angered neutral mobs attack any nearby player, not just the player that angered them.
-
-
-
Field Detail
-
ANNOUNCE_ADVANCEMENTS
public static final DefaultedRegistryReference<GameRule<Boolean>> ANNOUNCE_ADVANCEMENTS
If advancements should be announced to the server.This is a boolean game rule, with a default value of
true
.
-
COMMAND_BLOCK_OUTPUT
public static final DefaultedRegistryReference<GameRule<Boolean>> COMMAND_BLOCK_OUTPUT
WhetherCommandBlock
s should notify admins when they perform commands.This is a boolean game rule, with a default value of
true
.
-
DISABLE_ELYTRA_MOVEMENT_CHECK
public static final DefaultedRegistryReference<GameRule<Boolean>> DISABLE_ELYTRA_MOVEMENT_CHECK
Whether the server should skip checking player speed when the player is wearing elytra.This is a boolean game rule, with a default value of
false
.
-
DISABLE_RAIDS
public static final DefaultedRegistryReference<GameRule<Boolean>> DISABLE_RAIDS
-
DO_DAYLIGHT_CYCLE
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_DAYLIGHT_CYCLE
Whether the day-night cycle and moon phases progress.This is a boolean game rule, with a default value of
true
.
-
DO_ENTITY_DROPS
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_ENTITY_DROPS
Whether entities that are not mobs should have drops.This is a boolean game rule, with a default value of
true
.
-
DO_FIRE_TICK
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_FIRE_TICK
Whether fire should spread and naturally extinguish.This is a boolean game rule, with a default value of
true
.
-
DO_INSOMNIA
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_INSOMNIA
WhetherPhantom
s can spawn in the night-time.This is a boolean game rule, with a default value of
true
.
-
DO_IMMEDIATE_RESPAWN
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_IMMEDIATE_RESPAWN
WhetherPlayer
s should respawn immediately without showing the death screen.This is a boolean game rule, with a default value of
true
.
-
DO_LIMITED_CRAFTING
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_LIMITED_CRAFTING
WhetherPlayer
s can only craft recipes they have unlocked.This is a boolean game rule, with a default value of
false
.
-
DO_MOB_LOOT
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_MOB_LOOT
WhetherAgent
s should drop items.This is a boolean game rule, with a default value of
true
.
-
DO_MOB_SPAWNING
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_MOB_SPAWNING
WhetherAgent
s should naturally spawn.This is a boolean game rule, with a default value of
true
.
-
DO_PATROL_SPAWNING
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_PATROL_SPAWNING
Whetherpatrollers
will go out on patrol (typically in aRaid
.This is a boolean game rule, with a default value of
true
.
-
DO_TILE_DROPS
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_TILE_DROPS
Whether blocks should have drops.This is a boolean game rule, with a default value of
true
.
-
DO_TRADER_SPAWNING
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_TRADER_SPAWNING
Whethertraders
will naturally spawn.This is a boolean game rule, with a default value of
true
.
-
DO_WEATHER_CYCLE
public static final DefaultedRegistryReference<GameRule<Boolean>> DO_WEATHER_CYCLE
Whether the weather will change.This is a boolean game rule, with a default value of
true
.
-
DROWNING_DAMAGE
public static final DefaultedRegistryReference<GameRule<Boolean>> DROWNING_DAMAGE
Whether entities should take drowning damage.This is a boolean game rule, with a default value of
true
.
-
FALL_DAMAGE
public static final DefaultedRegistryReference<GameRule<Boolean>> FALL_DAMAGE
Whether entities should take fall damage.This is a boolean game rule, with a default value of
true
.
-
FIRE_DAMAGE
public static final DefaultedRegistryReference<GameRule<Boolean>> FIRE_DAMAGE
Whether entities should take fire damage.This is a boolean game rule, with a default value of
true
.
-
FORGIVE_DEAD_PLAYERS
public static final DefaultedRegistryReference<GameRule<Boolean>> FORGIVE_DEAD_PLAYERS
Makes angered neutral mobs stop being angry when the targeted player dies nearby.This is a boolean game rule, with a default value of
true
.
-
KEEP_INVENTORY
public static final DefaultedRegistryReference<GameRule<Boolean>> KEEP_INVENTORY
WhetherPlayer
s should keep items in their inventory after death.This is a boolean game rule, with a default value of
false
.
-
LOG_ADMIN_COMMANDS
public static final DefaultedRegistryReference<GameRule<Boolean>> LOG_ADMIN_COMMANDS
Whether to log admin commands to server log.This is a boolean game rule, with a default value of
true
.
-
MAX_COMMAND_CHAIN_LENGTH
public static final DefaultedRegistryReference<GameRule<Integer>> MAX_COMMAND_CHAIN_LENGTH
The total number ofchain command blocks
that can run during a single tick.This is a numerical game rule, with a default value of
65536
.
-
MAX_ENTITY_CRAMMING
public static final DefaultedRegistryReference<GameRule<Integer>> MAX_ENTITY_CRAMMING
The maximum number of other pushable entities a mob or player can push, before taking 3 suffocation damage per half-second.Damage affects
survival mode
oradventure mode
Player
s, and all mobs but bats. Pushable entities include non-spectator-modePlayer
, any mob exceptBat
s, as well asBoat
s andMinecartLike
.Setting to
0
disables the rule.This is a numerical game rule, with a default value of
24
.
-
MOB_GRIEFING
public static final DefaultedRegistryReference<GameRule<Boolean>> MOB_GRIEFING
WhetherAgent
s should be able to change blocks, and whetherAgent
s can pick up items.In vanilla Minecraft, the following entities can change blocks when this game rule is
true
:In vanilla Minecraft, the following entities can pick up items when this game rule is
true
:This is a boolean game rule, with a default value of
true
.
-
NATURAL_REGENERATION
public static final DefaultedRegistryReference<GameRule<Boolean>> NATURAL_REGENERATION
WhetherPlayer
s can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.).This is a boolean game rule, with a default value of
true
.
-
RANDOM_TICK_SPEED
public static final DefaultedRegistryReference<GameRule<Integer>> RANDOM_TICK_SPEED
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
This is a numerical game rule, with a default value of
3
.
-
REDUCED_DEBUG_INFO
public static final DefaultedRegistryReference<GameRule<Boolean>> REDUCED_DEBUG_INFO
Whether the debug screen shows all or reduced information.This is a boolean game rule, with a default value of
false
.
-
SEND_COMMAND_FEEDBACK
public static final DefaultedRegistryReference<GameRule<Boolean>> SEND_COMMAND_FEEDBACK
Whether the feedback from commands executed by aPlayer
should show up in chat.This game rule affects the default behavior of whether
CommandBlock
s store their output text.This is a boolean game rule, with a default value of
true
.
-
SHOW_DEATH_MESSAGES
public static final DefaultedRegistryReference<GameRule<Boolean>> SHOW_DEATH_MESSAGES
Whether a message appears in chat when aPlayer
dies.This is a boolean game rule, with a default value of
true
.
-
SPAWN_RADIUS
public static final DefaultedRegistryReference<GameRule<Integer>> SPAWN_RADIUS
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 spawn point.This is a numerical game rule, with a default value of
10
.
-
SPECTATORS_GENERATE_CHUNKS
public static final DefaultedRegistryReference<GameRule<Boolean>> SPECTATORS_GENERATE_CHUNKS
Whether players inspectator mode
can generate chunks.This is a boolean game rule, with a default value of
true
.
-
UNIVERSAL_ANGER
public static final DefaultedRegistryReference<GameRule<Boolean>> UNIVERSAL_ANGER
Makes angered neutral mobs attack any nearby player, not just the player that angered them.This is a boolean game rule, with a default value of
false
.
-
-