跳到主要内容

纯文字血条

样式不写 bar 就是纯文字血条,只有一行字浮在怪物头上。小怪很多时比图片血条清爽。

第 1 步:写样式​

plugins/CloudHealthBar/styles/text.yml:

text_only:
scale: 0.6
height: 0.3
elements:
line:
text: "<white>{name} <red>❤ {health_short}<gray>/{max_health_short}"
anchor: base

anchor: base 表示以怪物头顶为基准,没有血条图片时用这个。

第 2 步:套用​

让所有没单独写的 MythicMobs 怪物都用它,改 mobs.yml 的默认:

mythicmobs:
enabled: true
default:
style: text_only
triggers: [damage, look, near]

/chb reload,靠近怪物会看到「骷髅弓手 ❤ 18/20」这样的一行。

加一个半透明底​

字在亮的地方看不清时,加底色:

line:
text: "<white>{name} <red>❤ {health_short}<gray>/{max_health_short}"
anchor: base
background: "#60000000"

#AARRGGBB 格式,前两位是透明度,60 大约是四成不透明的黑底。

会踩的坑​

  • 纯文字血条一样要玩家载入资源包吗?只用一般文字和 <font:cloudhealthbar:...> 以外的字体时不用;用了 {icon:...}、{effects} 或像素数字字体就要。
  • 血量数字会跳,但没有残影和平滑动画,那是图片血条才有的。
0:000:00