# 类的使用
org.bukkit.GameRule

使用GameRule的程序包
程序包
说明
org.bukkit
Bukkit API的顶级程序包, 包含通用的API类和接口.

- ## org.bukkit中GameRule的使用

  声明为GameRule的org.bukkit中的字段
  修饰符和类型
  字段
  说明
  `static final GameRule<Boolean>`
  GameRule.`ANNOUNCE_ADVANCEMENTS`
  是否在聊天框中公告玩家进度的达成.
  `static final GameRule<Boolean>`
  GameRule.`BLOCK_EXPLOSION_DROP_DECAY`
  Whether block explosions will destroy dropped items.
  `static final GameRule<Boolean>`
  GameRule.`COMMAND_BLOCK_OUTPUT`
  命令方块执行命令时是否在聊天框中向管理员显示.
  `static final GameRule<Integer>`
  GameRule.`COMMAND_MODIFICATION_BLOCK_LIMIT`
  Determines the maximum number of blocks which a command can modify.
  `static final GameRule<Boolean>`
  GameRule.`DISABLE_ELYTRA_MOVEMENT_CHECK`
  是否让服务器停止检查使用鞘翅玩家的移动速度.
  `static final GameRule<Boolean>`
  GameRule.`DISABLE_RAIDS`
  是否禁用袭击.
  `static final GameRule<Boolean>`
  GameRule.`DO_DAYLIGHT_CYCLE`
  是否进行日夜交替和月相变化.
  `static final GameRule<Boolean>`
  GameRule.`DO_ENTITY_DROPS`
  非生物实体是否掉落物品.
  `static final GameRule<Boolean>`
  GameRule.`DO_FIRE_TICK`
  火是否蔓延及自然熄灭.
  `static final GameRule<Boolean>`
  GameRule.`DO_IMMEDIATE_RESPAWN`
  玩家死亡时是否不显示死亡界面直接重生.
  `static final GameRule<Boolean>`
  GameRule.`DO_INSOMNIA`
  幻翼是否在夜晚生成.
  `static final GameRule<Boolean>`
  GameRule.`DO_LIMITED_CRAFTING`
  玩家的合成配方是否需要解锁才能使用.
  `static final GameRule<Boolean>`
  GameRule.`DO_MOB_LOOT`
  生物在死亡是否掉落物品 (战利品).
  `static final GameRule<Boolean>`
  GameRule.`DO_MOB_SPAWNING`
  生物是否自然生成.
  `static final GameRule<Boolean>`
  GameRule.`DO_PATROL_SPAWNING`
  灾厄巡逻队是否自然生成.
  `static final GameRule<Boolean>`
  GameRule.`DO_TILE_DROPS`
  方块被破坏时是否掉落物品.
  `static final GameRule<Boolean>`
  GameRule.`DO_TRADER_SPAWNING`
  流浪商人是否自然生成.
  `static final GameRule<Boolean>`
  GameRule.`DO_VINES_SPREAD`
  Whether vines will spread.
  `static final GameRule<Boolean>`
  GameRule.`DO_WARDEN_SPAWNING`
  Whether wardens should naturally spawn.
  `static final GameRule<Boolean>`
  GameRule.`DO_WEATHER_CYCLE`
  天气是否变化.
  `static final GameRule<Boolean>`
  GameRule.`DROWNING_DAMAGE`
  玩家是否承受窒息伤害.
  `static final GameRule<Boolean>`
  GameRule.`ENDER_PEARLS_VANISH_ON_DEATH`
  Whether ender pearls will vanish on player death.
  `static final GameRule<Boolean>`
  GameRule.`FALL_DAMAGE`
  玩家是否承受跌落伤害.
  `static final GameRule<Boolean>`
  GameRule.`FIRE_DAMAGE`
  玩家是否承受火焰伤害.
  `static final GameRule<Boolean>`
  GameRule.`FORGIVE_DEAD_PLAYERS`
  当被激怒的中立生物的目标玩家死亡时, 此生物是否恢复中立状态.
  `static final GameRule<Boolean>`
  GameRule.`FREEZE_DAMAGE`
  玩家是否承受冰冻伤害.
  `static final GameRule<Boolean>`
  GameRule.`GLOBAL_SOUND_EVENTS`
  Whether global level events such as ender dragon, wither, and completed end portal effects will propagate across the entire server.
  `static final GameRule<Boolean>`
  GameRule.`KEEP_INVENTORY`
  玩家死亡后是否保留物品栏物品 (死亡时物品不掉落).
  `static final GameRule<Boolean>`
  GameRule.`LAVA_SOURCE_CONVERSION`
  Whether lava blocks can convert into lava source blocks.
  `static final GameRule<Boolean>`
  GameRule.`LOG_ADMIN_COMMANDS`
  是否在服务器日志中记录管理员使用过的命令.
  `static final GameRule<Integer>`
  GameRule.`MAX_COMMAND_CHAIN_LENGTH`
  指定工作在连锁模式的命令方块的总数量.
  `static final GameRule<Integer>`
  GameRule.`MAX_COMMAND_FORK_COUNT`
  Determines the number of different commands/functions which execute commands can fork into.
  `static final GameRule<Integer>`
  GameRule.`MAX_ENTITY_CRAMMING`
  玩家或生物能同时推动其它可推动实体的数量, 超过此数量时将承受窒息伤害.
  `static final GameRule<Boolean>`
  GameRule.`MOB_EXPLOSION_DROP_DECAY`
  * Whether mob explosions will destroy dropped items.
  `static final GameRule<Boolean>`
  GameRule.`MOB_GRIEFING`
  生物能否捡起物品, 修改以及破坏方块.
  `static final GameRule<Boolean>`
  GameRule.`NATURAL_REGENERATION`
  玩家是否能在饥饿值足够时自然恢复生命值 (不影响外部治疗效果, 如金苹果、生命恢复状态效果等).
  `static final GameRule<Integer>`
  GameRule.`PLAYERS_NETHER_PORTAL_CREATIVE_DELAY`
  The amount of time a player in creative mode must stand in a nether portal before the portal activates.
  `static final GameRule<Integer>`
  GameRule.`PLAYERS_NETHER_PORTAL_DEFAULT_DELAY`
  The amount of time a player must stand in a nether portal before the portal activates.
  `static final GameRule<Integer>`
  GameRule.`PLAYERS_SLEEPING_PERCENTAGE`
  服务器跳过夜晚所需的入睡玩家的占比.
  `static final GameRule<Boolean>`
  GameRule.`PROJECTILES_CAN_BREAK_BLOCKS`
  Whether projectiles can break blocks.
  `static final GameRule<Integer>`
  GameRule.`RANDOM_TICK_SPEED`
  每游戏刻每区块中随机的方块刻发生的频率 (例如植物生长，树叶腐烂等).
  `static final GameRule<Boolean>`
  GameRule.`REDUCED_DEBUG_INFO`
  调式屏幕是否显示简化的信息而非详细信息.
  `static final GameRule<Boolean>`
  GameRule.`SEND_COMMAND_FEEDBACK`
  玩家执行命令的返回信息是否在聊天框中显示.
  `static final GameRule<Boolean>`
  GameRule.`SHOW_DEATH_MESSAGES`
  是否在聊天框中显示玩家以及驯养宠物的死亡信息.
  `static final GameRule<Integer>`
  GameRule.`SNOW_ACCUMULATION_HEIGHT`
  `static final GameRule<Integer>`
  GameRule.`SPAWN_CHUNK_RADIUS`
  The number of chunks around spawn which will be kept loaded at all times.
  `static final GameRule<Integer>`
  GameRule.`SPAWN_RADIUS`
  首次进入服务器的玩家和没有重生点的死亡玩家在重生时与世界重生点坐标的距离.
  `static final GameRule<Boolean>`
  GameRule.`SPECTATORS_GENERATE_CHUNKS`
  是否允许旁观模式的玩家生成区块.
  `static final GameRule<Boolean>`
  GameRule.`TNT_EXPLOSION_DROP_DECAY`
  Whether tnt explosions will destroy dropped items.
  `static final GameRule<Boolean>`
  GameRule.`UNIVERSAL_ANGER`
  当中立生物被激怒时, 是否攻击附近所有玩家 (而不仅仅是激怒此生物的玩家).
  `static final GameRule<Boolean>`
  GameRule.`WATER_SOURCE_CONVERSION`
  Whether water blocks can convert into water source blocks.
  返回GameRule的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `static @Nullable GameRule<?>`
  GameRule.`getByName(@NotNull String rule)`
  按名称获取`游戏规则`.
  `static @NotNull GameRule<?>[]`
  GameRule.`values()`
  获取一个不可变的`游戏规则`集合.
  参数类型为GameRule的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `<T> T`
  World.`getGameRuleDefault(@NotNull GameRule<T> rule)`
  获取给定`游戏规则`的默认值.
  `<T> T`
  World.`getGameRuleValue(@NotNull GameRule<T> rule)`
  获取给定的`游戏规则`的数据值.
  `<T> boolean`
  World.`setGameRule(@NotNull GameRule<T> rule, T newValue)`
  设置给定`游戏规则`的数据值.