有毒○贰比
如题,我想把一个tag=Y,血量是150的僵尸血量显示在Bossbar上面,死亡后便消失。

咋弄



SPGoding
以下命令执行一次:

代码:

  1. bossbar add y_health "僵尸血量"
  2. bossbar set y_health max 150



以下命令高频执行:

代码:

  1. bossbar set y_health players @a
  2. execute if entity @e[type=zombie,tag=Y] run bossbar set y_health visible true
  3. execute unless entity @e[type=zombie,tag=Y] run bossbar set y_health visible false
  4. execute store result bossbar y_health value run data get entity @e[type=zombie,limit=1,tag=Y] Health

下一页 最后一页