Show Minecraft Command scoreboard as a name?

co
3

I want to make a map but I need an HP ad about mobs. I can set a name. But I want the score from the scoreboard and then "HP" to be displayed. It should look something like this

Pa

As far as I know, this is not directly possible with commands.

One possibility that immediately occurs to me would be to spawn an invisible ArmorStand for each player who has a visible name with the respective information.

But what I don't think is possible to change the color of the name.

co

But how do you integrate the scoreboard score into the CustomName?

Pa

https://www.reddit.com/...ard_on_an/

The problem has already been addressed here.

So the solution is to first have a sign somewhere (preferably in a chunk that is always being loaded, like spawn chunk) and then to copy the text string into the name of the ArmorStand.