主题
这页只做一件事:快速告诉你 属性配置现在该写哪些字段。
当前推荐写法
yml
thunder_damage:
display: "雷元素攻击"
names:
- "雷元素攻击"
- "雷伤"
read-pattern: default
default: 0.0
min: 0.0
max: 999999.0
channel: thunder
channel-role: damage字段速查表
| 语义 | 字段 | 说明 |
|---|---|---|
| 显示名 | display | 玩家看到的属性名 |
| 别名列表 | names | Lore 里可识别的名字集合 |
| 读取模式 | read-pattern | 例如 default、range |
| 默认值 | 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,例如:
physicalfireicethunder
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_chance、max_health 这种普通属性通常不需要。
最推荐模板
yml
your_attribute_id:
display: "你的属性显示名"
names:
- "你的属性显示名"
- "Lore 里可能出现的简称"
read-pattern: default
default: 0.0
min: 0.0
max: 999999.0