Skip to content

这页只做一件事:快速告诉你 属性配置现在该写哪些字段


当前推荐写法

yml
thunder_damage:
  display: "雷元素攻击"
  names:
    - "雷元素攻击"
    - "雷伤"
  read-pattern: default
  default: 0.0
  min: 0.0
  max: 999999.0
  channel: thunder
  channel-role: damage

字段速查表

语义字段说明
显示名display玩家看到的属性名
别名列表namesLore 里可识别的名字集合
读取模式read-pattern例如 defaultrange
默认值default未提供来源时的基础值
最小值min允许的最小值
最大值max允许的最大值
伤害通道channel声明属性属于哪个伤害通道
通道角色channel-role声明属性在通道里的角色

常见字段怎么写

1. display

yml
display: "雷元素攻击"

给玩家看的主显示名。

2. names

yml
names:
  - "雷元素攻击"
  - "雷伤"

Lore 读取时会按这里的名字去匹配。

3. read-pattern

yml
read-pattern: default

控制 Lore 数值的读取方式。

4. default / min / max

yml
default: 0.0
min: 0.0
max: 999999.0

这三个字段建议成组写清楚。


常见错误

错误 1:漏写 max 导致 GUI 出现超大数字

如果你漏写了 max,系统可能回退到非常大的默认边界值,GUI 里就可能看到:

text
1.7976931348623157E308

这通常不是计算炸了,而是边界字段没写完整

错误 2:把参与通道结算的属性漏了 channel / channel-role

如果一个属性要参与伤害通道结算,就要把这两个字段写上。


伤害通道字段

channel

声明属性属于哪个伤害通道。值通常是通道 ID,例如:

  • physical
  • fire
  • ice
  • thunder

channel-role

声明属性在通道中的角色:

含义示例
damage伤害来源attack_damage, fire_damage
resist抗性defense, fire_resistance
penetration_flat固定穿透physical_penetration_flat
penetration_rate百分比穿透physical_penetration_rate

示例

yml
fire_damage:
  display: "&c火焰伤害"
  names: ["火焰伤害", "火伤"]
  default: 0.0
  channel: fire
  channel-role: damage

fire_resistance:
  display: "&6火焰抗性"
  names: ["火焰抗性", "火抗"]
  default: 0.0
  channel: fire
  channel-role: resist

不是所有属性都需要这两个字段。只有参与伤害通道结算的属性才需要声明,例如 crit_chancemax_health 这种普通属性通常不需要。


最推荐模板

yml
your_attribute_id:
  display: "你的属性显示名"
  names:
    - "你的属性显示名"
    - "Lore 里可能出现的简称"
  read-pattern: default
  default: 0.0
  min: 0.0
  max: 999999.0

配套阅读

HN 系列插件文档