主题
概述
hna-removebuff 用于移除目标身上指定的 Buff。
基本语法
yaml
- hna-removebuff{参数} @目标选择器参数列表
| 参数 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
key | id | 字符串 | - | 要移除的 Buff key(必填) |
基本示例
yaml
# 移除目标的"力量提升" Buff
- hna-removebuff{key="力量提升"} @target
# 移除目标的"重伤" Debuff
- hna-removebuff{key="重伤"} @target实际应用场景
场景 1:净化技能
yaml
Purify:
Skills:
- hna-removebuff{key="中毒"} @target
- hna-removebuff{key="重伤"} @target
- hna-removebuff{key="虚弱"} @target
- effect:particles{p=HEART;a=10} @target
- message{m="&a你已被净化!"} @target场景 2:驱散敌方增益
yaml
Dispel:
Skills:
- hna-removebuff{key="力量提升"} @target
- hna-removebuff{key="护体"} @target
- message{m="&c敌人的增益被驱散了!"} @Self场景 3:技能状态重置
yaml
ResetCombo:
Skills:
- hna-removebuff{key="连击"} @Self
- message{m="&e连击状态已重置"} @Self场景 4:条件性移除
yaml
ConditionalRemove:
Skills:
# 如果目标有"重伤" Buff,则移除并造成额外伤害
- hna-hasbuff{key="重伤"} true
- hna-removebuff{key="重伤"} @target
- hna-damage{amount=200} @target
- message{m="&c重伤引爆!"} @target完整技能示例
yaml
CleanseSkill:
Cooldown: 20
Skills:
# 检查目标是否有 Debuff
- hna-hasbuff{key="中毒"} true
- hna-removebuff{key="中毒"} @target
- effect:particles{p=VILLAGER_HAPPY;a=20} @target
- hna-hasbuff{key="重伤"} true
- hna-removebuff{key="重伤"} @target
- effect:particles{p=VILLAGER_HAPPY;a=20} @target
- message{m="&a净化完成!"} @target注意事项
key参数必须与目标身上的 Buff key 完全匹配- 不写
key参数时不会移除任何 Buff - 如果目标没有该 Buff,不会报错
- 只移除指定的 Buff,不影响其他 Buff
- 需要明确的目标选择器
与 hna-clearbuff 的区别
hna-removebuff:移除指定 Buffhna-clearbuff:移除所有 Buff
调试方法
text
/hnattr buffs
/hnattr source