0

I would like to create other mobs that have health bars like the ones you see when fighting withers or the ender dragon; or like name tags that have health displayed. I want it to work for Minecraft 1.11.2. I have found this and similar but I have run into the following problems:

  1. The commands are out of date, all I can find is commands in 1.8,
  2. Most of them are mods and plug-ins, and
  3. The process descriptions for multiple commands are unclear and also out of date.
7
  • 6
    Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
    – Frank
    Mar 31, 2017 at 12:27
  • I wouldn't be asking this question if I hadn't had any knowledge of what I was doing, @Frank . I am also asking this because I know people who would like to have the answer to this question as well. If you need me to clarify the question than here it is: Is there a way to to make a health meter for monsters other than just withers and ender dragons. I prefer to use commands instead of mods for obvious reasons. I am running Minecraft 1.11.2.
    – user126825
    Mar 31, 2017 at 14:46
  • 5
    I'm not asking you to clarify your question; I'm asking you to show what work you've put in to solve this. If you haven't done anything, you're going to have a rough reception here. We expect askers to at least make an attempt to solve their problem. Remember, we're all volunteers here, so respect our time.
    – Frank
    Mar 31, 2017 at 14:48
  • 2
    That's a start. It'd be better if you had actual commands you had tried, as well.
    – Frank
    Apr 1, 2017 at 15:11
  • 1
    Curious, why did you accept an answer and then place a bounty? You should unaccept the other one if you do not like it and accept the one you found most useful.
    – Timmy Jim
    Apr 13, 2017 at 14:16

1 Answer 1

4
+50

Have you tried making it yourself?

What you can try doing is:

  1. Assign a scoreboard value based on a mob's health.

NB: You cannot use the health criteria on entities. Only players.
/scoreboard objectives add healthbar dummy

  1. Test for mob healths and assign them a score based on their current health in a repeater command block.

/scoreboard players set @e healthbar __ {Health:__s}
Replace __ with a health value, and repeat from 1 (half a heart) to 100 (max health of golems).
You should have a long row of command blocks just doing this if you're doing it correctly.

  1. Give mob names based on their health. Here's two unicode symbols that represent hearts: ♥♡, every tick after #2 happens.

If you know what you are doing, you can find your heart symbols in here.
/entitydata @e[score_healthbar_min=20,score_healthbar=20] {CustomName:"♥♥♥♥♥♥♥♥♥♥"} /entitydata @e[score_healthbar_min=18,score_healthbar=19] {CustomName:"♥♥♥♥♥♥♥♥♥♡"} /entitydata @e[score_healthbar_min=16,score_healthbar=17] {CustomName:"♥♥♥♥♥♥♥♥♡♡"} /entitydata @e[score_healthbar_min=14,score_healthbar=15] {CustomName:"♥♥♥♥♥♥♥♡♡♡"}
and so on... Of course, you could just do plain numbers:
/entitydata @e[score_healthbar_min=20,score_healthbar=20] {CustomName:"♥ 20"}
/entitydata @e[score_healthbar_min=19,score_healthbar=19] {CustomName:"♥ 19"}
/entitydata @e[score_healthbar_min=18,score_healthbar=18] {CustomName:"♥ 18"}
/entitydata @e[score_healthbar_min=17,score_healthbar=17] {CustomName:"♥ 17"}
or, if you cannot use Unicode:
/entitydata @e[score_healthbar_min=20,score_healthbar=20] {CustomName:"Health: 20"}
/entitydata @e[score_healthbar_min=19,score_healthbar=19] {CustomName:"Health: 19"}
/entitydata @e[score_healthbar_min=18,score_healthbar=18] {CustomName:"Health: 18"}
/entitydata @e[score_healthbar_min=17,score_healthbar=17] {CustomName:"Health: 17"}

If you know what you're doing, you should have a long chain of about about 150 chain command blocks and a repeat command block and mobs should have health bar as their custom name. Less, if you only only want to test a smaller health range, or put all mobs with more than 20 health as "20+" or any other optimisation changes, etc.

The downsides to this system however, is ALL NAMETAG NAMES WILL BE OVERWRITTEN.
A workaround would be to put @e[type=MOBNAME], but that would multiply the number of commands you have to create by the number of mobs you want to track.

Or, you could look at this answer on how to tag specific mob types and then instead of the above paragraph, just edit your health testing commands to only test selected mobs. Of course, you would need a few more extra command blocks to do your marking of mobs that should have their health tracked and displayed and the command blocks handling steps 2 and 3 should have a selector to filter for those mobs too.

2
  • This answer is exactly what I was looking for. But before I award, you need to specify where or how you can obtain the unicode "heart" symbols.
    – user126825
    Apr 11, 2017 at 23:25
  • 1
    Have even made the effort to copy-paste them from this page or doing a little googling? Here's the Unicode charts for block U+2700?
    – aytimothy
    Apr 12, 2017 at 0:23

You must log in to answer this question.