Skip to content

触发器

触发器决定关卡何时自动启动。当触发器条件满足且关卡未在运行中、冷却已过时,关卡会自动启动。

所有触发器都要求玩家位于关卡的区域范围内才会生效。

move-prob — 移动概率触发

玩家在区域内移动时按概率触发。

yaml
trigger:
  type: move-prob
  prob: 0.05
  min-distance: 0.3
配置项类型默认值说明
probDouble0.05触发概率,范围 0.0-1.0
min-distanceDouble0.3最小移动距离,低于此值不检测

death-prob — 死亡概率触发

玩家在区域内死亡时按概率触发。

yaml
trigger:
  type: death-prob
  prob: 0.05
配置项类型默认值说明
probDouble0.05触发概率

kill-prob — 击杀概率触发

击杀指定 MythicMobs 怪物时按概率触发。

yaml
trigger:
  type: kill-prob
  prob: 0.05
  mob-id: SkeletalKnight
配置项类型默认值说明
probDouble0.05触发概率
mob-idStringMythicMobs 怪物 ID(必填)

collect-prob — 收集物品触发

拾取包含指定 Lore 文本的物品时按概率触发。

yaml
trigger:
  type: collect-prob
  prob: 0.05
  item-lore: "特殊物品"
配置项类型默认值说明
probDouble0.05触发概率
item-loreString物品 Lore 中需要包含的文本(必填)

damage-prob — 受击概率触发

玩家在区域内受到伤害,且伤后血量低于指定百分比时按概率触发。

yaml
trigger:
  type: damage-prob
  prob: 0.05
  health-percent: 30
配置项类型默认值说明
probDouble0.05触发概率
health-percentInt30血量百分比阈值,伤后血量低于此值才可能触发

money-prob — 金币检测触发

玩家在区域内移动时,如果持有金币达到指定数量则按概率触发。需要 Vault 经济插件。

yaml
trigger:
  type: money-prob
  prob: 0.05
  min-money: 1000
配置项类型默认值说明
probDouble0.05触发概率
min-moneyDouble1000.0最小金币数量

player-count — 人数检测触发

区域内在线玩家数量达到要求时按概率触发。

yaml
trigger:
  type: player-count
  prob: 0.05
  required-players: 5
配置项类型默认值说明
probDouble0.05触发概率
required-playersInt5所需的玩家数量

TIP

所有触发器的 prob 字段表示触发概率,0.05 即 5%。设为 1.0 可以让条件满足时必定触发。

基于 TabooLib 构建的 Minecraft 区域关卡插件