Minecraft Easy Boss with Health Bar Toturial [command blocks]

preview_player
Показать описание
Used Minecraft java 1.21 version
change "Boss_name" to the name you want to use (Don't delete quotation marks)

Primary commands (need to be the operator of the server):
/give @p minecraft:command_block
/gamerule commandBlockOutput false

-----

First line of Command blocks:

1.1 [Impulse, Unconditional, Needs Redstone]
/summon wither_skeleton ~ ~ ~ {CustomName:'[{"text":"Boss_name"}]',CustomNameVisible:1b,PersistenceRequired:1b}

1.2 [Chain, Unconditional, Always active]
/bossbar add health "Boss_name"

1.3 [Chain, Unconditional, Always active]
/tag @e[type=minecraft:wither_skeleton] add mob

1.4 [Chain, Unconditional, Always active]
/execute store result bossbar minecraft:health max run data get entity @e[tag=mob,limit=1] Health


-----

Second line of Command blocks:

2.1 [Repeat, Unconditional, Always active]
/execute store result bossbar minecraft:health value run data get entity @e[tag=mob,limit=1] Health

2.2 [Chain, Unconditional, Always active]
/execute if entity @e[tag=mob] run bossbar set minecraft:health players @a

2.3 [Chain, Unconditional, Always active]
/execute unless entity @e[tag=mob] run bossbar set minecraft:health players

2.4 [Chain, Unconditional, Always active]
/execute unless entity @e[tag=mob] run bossbar remove minecraft:health
Рекомендации по теме
Комментарии
Автор

These commands give the health bar only to the specified entity closest to the first command block, so place this rig accordingly. It also doesn't work when two of the entities are alive

hmmsbasement