Skip to content

主配置 config.yml

plugins/GTDamage/config.yml 控制伤害类型识别、伤害数字显示、原版爱心压缩、怪物血条、字体映射、兼容插件和性能限制。

修改后执行:

text
/gtdamage reload

如果切换显示 provider、ProtocolLib、Adyeshach 或低版本兼容相关配置,建议重启服务器。

crane-attribute 属性映射

虽然节点名叫 crane-attribute,这里的映射会被多个适配器共用,包括 CraneAttribute、AttributePlus、SX-Attribute 等。

yaml
crane-attribute:
  trigger-attributes:
    "暴击率": "critical"
    "暴击几率": "critical"
    "Crit": "critical"
  attribute-type-mapping:
    "物理伤害": "physical"
    "魔法伤害": "magic"
    "真实伤害": "true"
  default-type: "physical"
  type-weights:
    critical: 10
    true: 15
    physical: 1

trigger-attributes

触发型属性映射,例如暴击率、吸血几率、落雷几率。

yaml
trigger-attributes:
  "暴击率": "critical"
  "暴击几率": "critical"
  "CRIT_CHANCE": "critical"

含义:当适配器检测到这些属性触发时,伤害数字显示为 critical 类型。

attribute-type-mapping

常驻属性映射,用于根据攻击者属性判断伤害类型。

yaml
attribute-type-mapping:
  "物理伤害": "physical"
  "魔法伤害": "magic"
  "火焰伤害": "fire"

如果 AP 中使用 暴击几率,CA 中使用 暴击率,可以都映射到 critical

type-weights

多个类型同时命中时,权重高的优先。

yaml
type-weights:
  true: 15
  lightning: 12
  critical: 10
  physical: 1

例如一次伤害同时满足真实伤害和物理伤害,最终显示真实伤害。

hologram 伤害数字显示

yaml
hologram:
  mode: auto
  display-time: 60
  height-offset: 2.5
  random-offset:
    enabled: true
    x: 0.5
    y: 0.5
    z: 0.5
  animation:
    enabled: true
    types:
      - float
    float-speed: 0.02
    float-distance: 0.8

mode 可选:

text
auto    自动选择
native  原生 Bukkit TextDisplay
ady     Adyeshach 虚拟实体
packet  ProtocolLib 虚拟 ArmorStand,失败后回退
字段作用
display-time显示时间,tick
height-offset头顶高度偏移
random-offset随机偏移,避免数字重叠
animation.types动画类型

动画类型:

text
float     匀速上浮
parabola  抛物线
burst     爆开

伤害数字太密集时可减少显示时间:

yaml
hologram:
  display-time: 40

text 黑色背景

yaml
text:
  transparent-background: true

1.19.4+ TextDisplay 默认可能有黑色背景。开启后会尽量使用透明背景显示。
低版本不支持 TextDisplay 时会自动回退。

damage-indicator 原版爱心粒子

yaml
damage-indicator:
  enabled: false
  ratio: "0"

用于控制原版受击爱心粒子,需要 ProtocolLib。

ratio 支持:

text
0        完全关闭
10%      保留 10%
50%      保留 50%
10:1     10 个压成 1 个
1000:1   1000 个压成 1 个

完全关闭爱心:

yaml
damage-indicator:
  enabled: true
  ratio: "0"

只保留一半:

yaml
damage-indicator:
  enabled: true
  ratio: "50%"

mob-health 怪物血条

yaml
mob-health:
  enabled: false
  mode: "persistent"
  provider: "auto"
  format: "§f{name} §8[§a{bar}§8] §c{health}§7/§c{max} §e{percent}%"
  display-time: 40
  update-interval: 10
  height-offset: 0.45
  view-distance: 32.0
  show-players: false
  only-attacker: false
  hide-at-zero: true
  decimal-places: 0
  bar:
    length: 10
    full: "§a|"
    empty: "§7|"

mode

text
hit         受击后显示一段时间
persistent  附近怪物持续显示

provider

text
auto              自动选择
entity-name       发包修改怪物本体名字,低占用、跟随自然
textdisplay       独立 TextDisplay
packet-armorstand ProtocolLib 虚拟 ArmorStand,低版本兜底
armorstand        原生 ArmorStand 兜底

变量:

text
{name}     怪物名
{health}   当前血量
{max}      最大血量
{percent}  百分比
{bar}      血条

推荐 persistent 血条:

yaml
mob-health:
  enabled: true
  mode: "persistent"
  provider: "auto"
  update-interval: 10
  view-distance: 32.0

如果想要更省性能:

yaml
mob-health:
  enabled: true
  mode: "hit"
  provider: "auto"
  display-time: 60

format 数字格式

yaml
format:
  decimal-places: 1
  thousands-separator: ","
  decimal-separator: "."
  min-display-value: 0.1
字段作用
decimal-places小数位数
thousands-separator千位分隔符
decimal-separator小数点符号
min-display-value小于 1 时最低显示值

只显示整数:

yaml
format:
  decimal-places: 0

显示 18,400.0

yaml
format:
  decimal-places: 1
  thousands-separator: ","

range 显示范围

yaml
range:
  view-distance: 30
  only-for-combatants: false
字段作用
view-distance可视距离
only-for-combatants是否只给攻击者和受害者显示

大型副本或多人场景推荐:

yaml
range:
  view-distance: 24
  only-for-combatants: true

filter 过滤

yaml
filter:
  ignored-damage-causes: []
  ignored-entity-types: []
  min-damage: 0.0
  ignore-self-damage: true

忽略摔落和燃烧:

yaml
filter:
  ignored-damage-causes:
    - FALL
    - FIRE_TICK

忽略小于 1 的伤害:

yaml
filter:
  min-damage: 1.0

damage-types 伤害类型样式

yaml
damage-types:
  physical:
    color: "§f"
    prefix: ""
    suffix: ""
    scale: 1.0
    scale-enabled: false
  critical:
    color: "§6"
    prefix: "§l✦ "
    suffix: "§r"
    scale: 1.5
    scale-enabled: true
字段作用
color数字颜色
prefix数字前缀
suffix数字后缀
scale显示倍率
scale-enabled是否启用显示倍率

新增一个冰霜伤害:

yaml
damage-types:
  frost:
    color: "§b"
    prefix: "❄ "
    suffix: ""
    scale: 1.0
    scale-enabled: false

然后在属性映射里把属性映射到 frost

yaml
crane-attribute:
  attribute-type-mapping:
    "冰霜伤害": "frost"

font-mapping 字体映射

yaml
font-mapping:
  enabled: false
  papi-support: false
  groups:
    default:
      permission: ""
      weight: 0
      mapping:
        "0": "零"
        "1": "一"

用于把数字替换成自定义字体字符或材质包字符。

字段作用
enabled是否启用字体映射
papi-support映射前是否解析 PAPI
permission使用该字体组需要的权限
weight权重,越高优先
mapping字符替换表

VIP 字体:

yaml
font-mapping:
  enabled: true
  groups:
    vip:
      permission: "gtdamage.font.vip"
      weight: 10
      mapping:
        "0": "𝟎"
        "1": "𝟏"

compatibility 兼容优先级

yaml
compatibility:
  enabled: false
  plugin-priority:
    CraneAttribute: 80
    SX-Attribute: 60
    AttributePlus: 50
    LegendAttribute: 40

多属性插件共存时开启:

yaml
compatibility:
  enabled: true

优先级越高,越先采用该插件返回的属性结果。

performance 性能

yaml
performance:
  max-holograms: 100
  cleanup-interval: 100
  async-processing: true
  max-events-per-tick: 50
字段作用
max-holograms最大同时显示数量
cleanup-interval清理检查间隔
async-processing是否异步处理
max-events-per-tick每 tick 最大处理伤害事件

高怪物密度场景:

yaml
performance:
  max-holograms: 80
  cleanup-interval: 80
  async-processing: true
  max-events-per-tick: 40

debug 调试

yaml
debug:
  enabled: false
  verbose: false
  log-damage-events: false

排查 AP / CA 伤害类型识别:

yaml
debug:
  enabled: true
  verbose: true
  log-damage-events: true

测试完成后关闭。

验证流程

  1. 执行 /gtdamage reload
  2. 打一只普通怪,确认伤害数字出现。
  3. 打带属性的怪或玩家,确认伤害类型颜色和前缀正确。
  4. 开启 mob-health.enabled 后,确认怪物头顶血条刷新。
  5. 如果使用 AP / CA,开启 debug 看属性名是否被映射到正确类型。