主题
概述
hna-buff 用于给目标施加 Buff 效果。
基本语法
yaml
- hna-buff{参数} @目标选择器参数列表
| 参数 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
key | id | 字符串 | - | Buff 的 key(必填) |
time | duration | 整数 | 0 | 持续时间(tick) |
level | lv, amplifier | 整数 | 1 | Buff 等级 |
基本示例
yaml
# 施加 100 tick 的 1 级"力量提升" Buff
- hna-buff{key="力量提升";time=100;level=1} @target
# 施加 200 tick 的 2 级"护体" Buff
- hna-buff{key="护体";time=200;level=2} @target实际应用场景
场景 1:Boss 给玩家施加 Debuff
yaml
BossDebuff:
Skills:
- hna-buff{key="重伤";time=200;level=1} @target
- message{m="&c你被 Boss 重伤了!"} @target场景 2:治疗技能附带增益
yaml
HealingBuff:
Skills:
- heal{amount=50} @target
- hna-buff{key="生命恢复";time=100;level=1} @target场景 3:技能连击系统
yaml
ComboStrike:
Skills:
- hna-damage{amount=100} @target
- hna-buff{key="连击";time=60;level=1} @Self场景 4:区域增益光环
yaml
AreaBuff:
Skills:
- hna-buff{key="力量提升";time=100;level=2} @PlayersInRadius{r=10}完整技能示例
yaml
StrengthAura:
Cooldown: 30
Skills:
# 给自己施加力量光环
- hna-buff{key="力量光环";time=200;level=1} @Self
- effect:particles{p=FLAME;a=20;hs=0.5;vs=0.5} @Self
- message{m="&e力量光环已激活!"} @Self
# 每秒给周围玩家施加力量提升
- delay 20
- hna-buff{key="力量提升";time=40;level=1} @PlayersInRadius{r=8}
- delay 20
- hna-buff{key="力量提升";time=40;level=1} @PlayersInRadius{r=8}
# ... 重复多次注意事项
key参数必须与buffs.yml中定义的 Buff key 匹配- 不写
key参数时不会施加 Buff time单位是 tick(20 tick = 1 秒)level从 1 开始,不是从 0 开始- 需要明确的目标选择器
Buff 重施策略
Buff 的重施行为由 buffs.yml 中的 reapply-mode 控制:
refresh:刷新时长,保持最高等级stack:叠加层数replace:直接替换ignore:忽略新的施加
详见 Buff 配置速查。
调试方法
text
/hnattr buffs
/hnattr source
/hnattr trace <属性ID>