LogoArcartX Doc

触发器、条件与 Action

用结构化 YAML 组合战斗、物品、等级、状态与视觉行为

一个结构化回调由三部分组成:trigger 决定何时开始,conditions 决定是否继续,actions 决定执行什么。先从本页选择所需内容,再到回调与 Aria 脚本组合完整配置。能用条件与 Action 表达的玩法不需要编写脚本。

内置触发器

属性与战斗

  • attribute.calculate
  • combat.attack_preparecombat.attack_confirmed
  • combat.meleecombat.rangedcombat.critical
  • combat.damage_dealtcombat.damage_takencombat.damage_confirmed
  • combat.block_confirmedcombat.dodge
  • combat.killcombat.deathcombat.low_health
  • combat.entercombat.leave

实体、物品与玩家

  • entity.moveentity.jumpentity.sneakentity.sprintentity.timer
  • item.interactitem.left_clickitem.right_click
  • item.equipitem.unequipitem.held_changeitem.consumeitem.damage
  • player.joinplayer.quitplayer.respawnplayer.level_up
  • skill.castskill.hitstatus.tick

player.level_up 只会在外部等级数据刷新且等级上升时触发。

条件

type主要字段说明
chancevalue0 到 1 的概率
cooldownkeyduration-ms条件成功后开始冷却
healthtargetoperatorvaluepercent比较当前生命或比例
leveltargetoperatorvalue读取外部等级
worldnames比较 self 所在世界
biomenamestarget比较目标群系
permissionpermissiontarget检查玩家权限
attributeattributeoperatorvaluetarget读取最终属性值
target_typeentity-types比较目标实体类型
posturevalue读取兼容层提供的姿态
equipmentslotitemtag读取本次触发涉及的装备
andorconditions组合多个条件
notcondition反转一个条件

支持的比较符为 >>=<<===!=

完整缩进写法:

conditions:
  - type: and
    conditions:
      - type: attribute
        attribute: arcane_resistance
        operator: '>='
        value: 25%
        target: self
      - type: level
        operator: '>='
        value: 30
        target: self
  - type: cooldown
    key: arcane_notice
    duration-ms: 2000

冷却条件会先检查,但只有同一个回调的所有条件都成立后才开始计时,避免条件失败却进入冷却。

Action

type主要字段说明
damagechannelamounttargetallow-critical额外造成一次伤害
healamounttargethealing_power 影响
attribute_buff属性、运算、值、持续时间创建到期来源
permanent_modifier属性、运算、值、key创建无到期时间的内存来源
skillskilltarget施放当前物品来源中的技能
potion效果、时长、等级、目标添加 Bukkit 药水效果
particle粒子、数量、偏移、目标播放粒子
sound声音、音量、音调、目标播放声音
messagemessagetarget发送用户配置的文本
commandcommandas由控制台或 self 执行命令
shieldamountmodetarget增加或设置护盾
status状态、层数、时长、目标应用状态

damageamount-per-stackheal 的同名字段可以读取当前状态层数。目标支持 selfcastertargetattackervictim;本次触发没有对应实体时,该动作不会凭空补出目标。

复杂战斗示例

callbacks:
  arcane_counter:
    trigger: combat.damage_taken
    priority: 50
    conditions:
      - type: attribute
        attribute: arcane_resistance
        operator: '>='
        value: 25%
        target: self
      - type: cooldown
        key: arcane_counter
        duration-ms: 3000
    actions:
      - type: shield
        amount: 20
        mode: add
        target: self
      - type: damage
        channel: arcane
        amount: 12
        target: attacker
        allow-critical: false
      - type: sound
        sound: block.amethyst_block.resonate
        volume: 0.8
        pitch: 1.2
        target: self

Action 造成的伤害会记录触发它的上一笔伤害,并受 max-transaction-depth 限制。不要配置会无限互相触发的反伤。

permanent_modifier 的“永久”只表示没有过期时间,来源仍只存在于当前进程。若重启后仍要存在,负责该玩法的附属插件应重新建立来源。

On this page