Interface GameRule<T>
- Type Parameters:
T- type of rule (Boolean or Integer)
- All Superinterfaces:
Keyed, RegistryAware
GameRules dictate certain behavior within Minecraft itself
For more information please visit the Minecraft Wiki
For more information please visit the Minecraft Wiki
-
Field Summary
FieldsModifier and TypeFieldDescriptionWhether time progresses from the current moment.Whether the weather will change from the current moment.Whether nether portals can be used to enter the nether.Whether blocks should have drops.Whether block explosions will destroy dropped items.Whether command blocks should notify admins when they perform commands.Whether command blocks are enabled.Whether drowning damage is enabled or not.Whether the server should skip checking player speed when the player is wearing elytra.Whether ender pearls will vanish on player death.Whether entities that are not mobs should have drops.Whether fall damage is enabled or not.Whether fire damage is enabled or not.The radius in blocks that fire can spread around a player (0 to disable spread, -1 to allow spread without players).Whether mobs should cease being angry at a player once they die.Whether freeze damage is enabled or not.Whether global level events such as ender dragon, wither, and completed end portal effects will propagate across the entire server.Whether clients will respawn immediately after death or not.Whether the player should keep items in their inventory after death.Whether lava blocks can convert into lava source blocks.Whether players should only be able to craft recipes they've unlocked first.Whether the locator bar is enabled.Whether to log admin commands to server log.Determines the maximum number of blocks which a command can modify.Determines the number of different commands/functions which execute commands can fork into.Determines the number at which the chain of command blocks act as a "chain."
This is the maximum amount of command blocks that can be activated in a single tick from a single chain.The maximum number of other pushable entities a mob or player can push, before taking suffocation damage.The maximum speed of minecarts (when the new movement algorithm is enabled).Whether mobs should drop items.* Whether mob explosions will destroy dropped items.Whether mobs can pick up items or change blocks.Whether players can regenerate health naturally through their hunger bar.Whether the server should skip checking player speed.The amount of time a player in creative mode must stand in a nether portal before the portal activates.The amount of time a player must stand in a nether portal before the portal activates.The percentage of online players which must be sleeping for the night to advance.Whether projectiles can break blocks.Whether PvP is enabled.Whether pillager raids are enabled or not.How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick.Whether the debug screen shows all or reduced information.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 spawnpoint.Whether the feedback from commands executed by a player should show up in chat.Toggles the announcing of advancements.Whether a message appears in chat when a player dies.Whether mobs should naturally spawn.Whether monsters will spawn.Whether patrols should naturally spawn.Whether phantoms will appear without sleeping or not.Whether traders should naturally spawn.Whether wardens should naturally spawn.Whether spawner blocks are enabled.Whether players in spectator mode can generate chunks.Whether vines will spread.Whether TNT explodes.Whether tnt explosions will destroy dropped items.Whether mobs will target all player entities once angered.Whether water blocks can convert into water source blocks. -
Method Summary
Modifier and TypeMethodDescriptionstatic GameRule<?> Deprecated.getKey()Deprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.getName()Deprecated.usegetKey()getType()Get the type of this rule.static GameRule<?>[]values()Deprecated.useIterable.iterator().Methods inherited from interface RegistryAware
getKeyOrNull, getKeyOrThrow, isRegistered
-
Field Details
-
SHOW_ADVANCEMENT_MESSAGES
-
COMMAND_BLOCK_OUTPUT
-
PLAYER_MOVEMENT_CHECK
-
ELYTRA_MOVEMENT_CHECK
-
ADVANCE_TIME
-
ENTITY_DROPS
-
LIMITED_CRAFTING
-
MOB_DROPS
-
PROJECTILES_CAN_BREAK_BLOCKS
-
SPAWN_MOBS
-
BLOCK_DROPS
-
ADVANCE_WEATHER
-
KEEP_INVENTORY
-
LOG_ADMIN_COMMANDS
-
MOB_GRIEFING
-
NATURAL_HEALTH_REGENERATION
-
REDUCED_DEBUG_INFO
-
SEND_COMMAND_FEEDBACK
-
SHOW_DEATH_MESSAGES
-
SPECTATORS_GENERATE_CHUNKS
-
RAIDS
-
SPAWN_PHANTOMS
-
IMMEDIATE_RESPAWN
-
DROWNING_DAMAGE
-
FALL_DAMAGE
-
FIRE_DAMAGE
-
FREEZE_DAMAGE
-
SPAWN_PATROLS
-
SPAWN_WANDERING_TRADERS
-
SPAWN_WARDENS
-
FORGIVE_DEAD_PLAYERS
-
UNIVERSAL_ANGER
-
BLOCK_EXPLOSION_DROP_DECAY
-
MOB_EXPLOSION_DROP_DECAY
-
TNT_EXPLOSION_DROP_DECAY
-
WATER_SOURCE_CONVERSION
-
LAVA_SOURCE_CONVERSION
-
GLOBAL_SOUND_EVENTS
-
SPREAD_VINES
-
ENDER_PEARLS_VANISH_ON_DEATH
-
TNT_EXPLODES
-
LOCATOR_BAR
-
PVP
-
ALLOW_ENTERING_NETHER_USING_PORTALS
-
SPAWN_MONSTERS
-
COMMAND_BLOCKS_WORK
-
SPAWNER_BLOCKS_WORK
-
RANDOM_TICK_SPEED
-
RESPAWN_RADIUS
-
MAX_ENTITY_CRAMMING
-
MAX_COMMAND_SEQUENCE_LENGTH
-
MAX_COMMAND_FORKS
-
MAX_BLOCK_MODIFICATIONS
-
PLAYERS_SLEEPING_PERCENTAGE
-
MAX_SNOW_ACCUMULATION_HEIGHT
-
PLAYERS_NETHER_PORTAL_DEFAULT_DELAY
-
PLAYERS_NETHER_PORTAL_CREATIVE_DELAY
-
MAX_MINECART_SPEED
@Experimental @MinecraftExperimental(MINECART_IMPROVEMENTS) static final GameRule<Integer> MAX_MINECART_SPEEDThe maximum speed of minecarts (when the new movement algorithm is enabled). -
FIRE_SPREAD_RADIUS_AROUND_PLAYER
-
-
Method Details
-
getKey
Deprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.Return the namespaced identifier for this object. -
getName
-
getType
-
getByName
Deprecated.only for backwards compatibility, useRegistry.get(NamespacedKey)instead.Get aGameRuleby its name.- Parameters:
rule- the name of the GameRule- Returns:
- the
GameRuleor null if no GameRule matches the given name
-
values
Deprecated.useIterable.iterator().Get an array ofGameRules.- Returns:
- an immutable collection containing all registered GameRules.
-
Registry.get(NamespacedKey)instead.