程序包 org.bukkit
接口 GameRule<T>
- 类型参数:
T- 游戏规则数值类型 (布尔值或整数)
- 所有超级接口:
Keyed,RegistryAware
-
字段概要
字段修饰符和类型字段说明是否进行日夜交替和月相变化.天气是否变化.Whether nether portals can be used to enter the nether.方块被破坏时是否掉落物品.Whether block explosions will destroy dropped items.命令方块执行命令时是否在聊天框中向管理员显示.Whether command blocks are enabled.玩家是否承受窒息伤害.是否让服务器停止检查使用鞘翅玩家的移动速度.Whether ender pearls will vanish on player death.非生物实体是否掉落物品.玩家是否承受跌落伤害.玩家是否承受火焰伤害.The radius in blocks that fire can spread around a player (0 to disable spread, -1 to allow spread without players).当被激怒的中立生物的目标玩家死亡时, 此生物是否恢复中立状态.玩家是否承受冰冻伤害.Whether global level events such as ender dragon, wither, and completed end portal effects will propagate across the entire server.玩家死亡时是否不显示死亡界面直接重生.玩家死亡后是否保留物品栏物品 (死亡时物品不掉落).Whether lava blocks can convert into lava source blocks.玩家的合成配方是否需要解锁才能使用.Whether the locator bar is enabled.是否在服务器日志中记录管理员使用过的命令.Determines the maximum number of blocks which a command can modify.Determines the number of different commands/functions which execute commands can fork into.指定工作在连锁模式的命令方块的总数量.玩家或生物能同时推动其它可推动实体的数量, 超过此数量时将承受窒息伤害.The maximum speed of minecarts (when the new movement algorithm is enabled).生物在死亡是否掉落物品 (战利品).* Whether mob explosions will destroy dropped items.生物能否捡起物品, 修改以及破坏方块.玩家是否能在饥饿值足够时自然恢复生命值 (不影响外部治疗效果, 如金苹果、生命恢复状态效果等).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.服务器跳过夜晚所需的入睡玩家的占比.Whether projectiles can break blocks.Whether PvP is enabled.是否禁用袭击.每游戏刻每区块中随机的方块刻发生的频率 (例如植物生长,树叶腐烂等).调式屏幕是否显示简化的信息而非详细信息.首次进入服务器的玩家和没有重生点的死亡玩家在重生时与世界重生点坐标的距离.玩家执行命令的返回信息是否在聊天框中显示.是否在聊天框中公告玩家进度的达成.是否在聊天框中显示玩家以及驯养宠物的死亡信息.生物是否自然生成.Whether monsters will spawn.灾厄巡逻队是否自然生成.幻翼是否在夜晚生成.流浪商人是否自然生成.Whether wardens should naturally spawn.Whether spawner blocks are enabled.是否允许旁观模式的玩家生成区块.Whether vines will spread.Whether TNT explodes.Whether tnt explosions will destroy dropped items.当中立生物被激怒时, 是否攻击附近所有玩家 (而不仅仅是激怒此生物的玩家).Whether water blocks can convert into water source blocks. -
方法概要
修饰符和类型方法说明已过时。getKey()已过时。A key might not always be present, useRegistryAware.getKeyOrThrow()instead.getName()已过时。请使用getKey()getType()获取此游戏规则的数据类型.values()已过时。请使用Iterable.iterator().从接口继承的方法 org.bukkit.registry.RegistryAware
getKeyOrNull, getKeyOrThrow, isRegistered
-
字段详细资料
-
SHOW_ADVANCEMENT_MESSAGES
是否在聊天框中公告玩家进度的达成. -
COMMAND_BLOCK_OUTPUT
命令方块执行命令时是否在聊天框中向管理员显示. -
PLAYER_MOVEMENT_CHECK
Whether the server should skip checking player speed. -
ELYTRA_MOVEMENT_CHECK
是否让服务器停止检查使用鞘翅玩家的移动速度. 有助于减轻因服务器延迟而导致的飞行卡顿, 但有可能导致生存模式下玩家飞行过快 (作弊). -
ADVANCE_TIME
是否进行日夜交替和月相变化. -
ENTITY_DROPS
非生物实体是否掉落物品. -
LIMITED_CRAFTING
玩家的合成配方是否需要解锁才能使用. -
MOB_DROPS
生物在死亡是否掉落物品 (战利品). -
PROJECTILES_CAN_BREAK_BLOCKS
Whether projectiles can break blocks. -
SPAWN_MOBS
生物是否自然生成. 不影响刷怪箱. -
BLOCK_DROPS
方块被破坏时是否掉落物品. -
ADVANCE_WEATHER
天气是否变化. -
KEEP_INVENTORY
玩家死亡后是否保留物品栏物品 (死亡时物品不掉落). -
LOG_ADMIN_COMMANDS
是否在服务器日志中记录管理员使用过的命令. -
MOB_GRIEFING
生物能否捡起物品, 修改以及破坏方块.译注:Mob包括的实体详见
Mob接口文档. -
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
Whether wardens should naturally spawn. -
FORGIVE_DEAD_PLAYERS
当被激怒的中立生物的目标玩家死亡时, 此生物是否恢复中立状态. -
UNIVERSAL_ANGER
当中立生物被激怒时, 是否攻击附近所有玩家 (而不仅仅是激怒此生物的玩家). -
BLOCK_EXPLOSION_DROP_DECAY
Whether block explosions will destroy dropped items. -
MOB_EXPLOSION_DROP_DECAY
* Whether mob explosions will destroy dropped items. -
TNT_EXPLOSION_DROP_DECAY
Whether tnt explosions will destroy dropped items. -
WATER_SOURCE_CONVERSION
Whether water blocks can convert into water source blocks. -
LAVA_SOURCE_CONVERSION
Whether lava blocks can convert into lava source blocks. -
GLOBAL_SOUND_EVENTS
Whether global level events such as ender dragon, wither, and completed end portal effects will propagate across the entire server. -
SPREAD_VINES
Whether vines will spread. -
ENDER_PEARLS_VANISH_ON_DEATH
Whether ender pearls will vanish on player death. -
TNT_EXPLODES
Whether TNT explodes. -
LOCATOR_BAR
Whether the locator bar is enabled. -
PVP
Whether PvP is enabled. -
ALLOW_ENTERING_NETHER_USING_PORTALS
Whether nether portals can be used to enter the nether. -
SPAWN_MONSTERS
Whether monsters will spawn. -
COMMAND_BLOCKS_WORK
Whether command blocks are enabled. -
SPAWNER_BLOCKS_WORK
Whether spawner blocks are enabled. -
RANDOM_TICK_SPEED
每游戏刻每区块中随机的方块刻发生的频率 (例如植物生长,树叶腐烂等). 为0时禁用随机刻, 较高的数字将增大随机刻频率. -
RESPAWN_RADIUS
首次进入服务器的玩家和没有重生点的死亡玩家在重生时与世界重生点坐标的距离. -
MAX_ENTITY_CRAMMING
玩家或生物能同时推动其它可推动实体的数量, 超过此数量时将承受窒息伤害.
设置成0可以停用这个规则. -
MAX_COMMAND_SEQUENCE_LENGTH
指定工作在连锁模式的命令方块的总数量.
该值是在同一连锁同一tick时可激活的最大命令方块数量. -
MAX_COMMAND_FORKS
Determines the number of different commands/functions which execute commands can fork into. -
MAX_BLOCK_MODIFICATIONS
Determines the maximum number of blocks which a command can modify. -
PLAYERS_SLEEPING_PERCENTAGE
服务器跳过夜晚所需的入睡玩家的占比. -
MAX_SNOW_ACCUMULATION_HEIGHT
-
PLAYERS_NETHER_PORTAL_DEFAULT_DELAY
The amount of time a player must stand in a nether portal before the portal activates. -
PLAYERS_NETHER_PORTAL_CREATIVE_DELAY
The amount of time a player in creative mode must stand in a nether portal before the portal activates. -
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
The radius in blocks that fire can spread around a player (0 to disable spread, -1 to allow spread without players).
-
-
方法详细资料
-
getKey
已过时。A key might not always be present, useRegistryAware.getKeyOrThrow()instead.返回用于此对象的命名空间标识符.原文:Return the namespaced identifier for this object.
-
getName
已过时。请使用getKey()获取此游戏规则的名称.原文:Get the name of this GameRule.
- 返回:
- 游戏规则名
-
getType
获取此游戏规则的数据类型.原文:Get the type of this rule.
- 返回:
- 游戏规则的数据类型;Integer 或 Boolean
-
getByName
@Nullable @Deprecated(since="1.21.11") static @Nullable GameRule<?> getByName(@NotNull @NotNull String rule) 已过时。仅作向下兼容, 请使用Registry.get(NamespacedKey)instead.- 参数:
rule- 游戏规则名- 返回:
游戏规则, 若没有与给定名称相匹配的GameRule返回null
-
values
已过时。请使用Iterable.iterator().- 返回:
- 包含所有已注册游戏规则的不可变集合
-
Registry.get(NamespacedKey)instead.