Skip to content

概述

hna-buff 用于给目标施加 Buff 效果。

基本语法

yaml
- hna-buff{参数} @目标选择器

参数列表

参数别名类型默认值说明
keyid字符串-Buff 的 key(必填)
timeduration整数0持续时间(tick)
levellv, amplifier整数1Buff 等级

基本示例

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}
  # ... 重复多次

注意事项

  1. key 参数必须与 buffs.yml 中定义的 Buff key 匹配
  2. 不写 key 参数时不会施加 Buff
  3. time 单位是 tick(20 tick = 1 秒)
  4. level 从 1 开始,不是从 0 开始
  5. 需要明确的目标选择器

Buff 重施策略

Buff 的重施行为由 buffs.yml 中的 reapply-mode 控制:

  • refresh:刷新时长,保持最高等级
  • stack:叠加层数
  • replace:直接替换
  • ignore:忽略新的施加

详见 Buff 配置速查

调试方法

text
/hnattr buffs
/hnattr source
/hnattr trace <属性ID>

相关文档

HN 系列插件文档