Arqade Asked by AruBr on August 4, 2021
My objective is to create a health bar above the mob’s head, and I was thinking about storing the data in a sign, and then setting the mob’s CustomName to the sign Text1, but this way I would need a sign for each mob of my world.
/scoreboard
could help.
scoreboard objectives add health health
# Put the following in a repeating command block
execute as @e[tag=track_health] run data merge @s {CustomName:'{"score":{"name":"@s","objective":"health"}}'}
data merge entity @e[tag=track_health,limit=1] {CustomName:'{"nbt":"Health","entity":"@e[tag=track_health,limit=1]"}'
setblock ~ ~ ~ minecraft:sign{Text1:'{"nbt":"Health","entity":"@e[tag=track_health,limit=1]"}'}
Answered by Makonede on August 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP