dragnoz

Entity Health Bar using Entitydata

Aug 11th, 2014
22,678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. 1. Setup scoreboard
  2. /scoreboard objectives add healthbar dummy
  3.  
  4. 2. Set scoreboard based on health
  5. /scoreboard players set @e healthbar 20 {Health:20s}
  6. /scoreboard players set @e healthbar 18 {Health:19s}
  7. /scoreboard players set @e healthbar 18 {Health:18s}
  8. /scoreboard players set @e healthbar 16 {Health:17s}
  9. /scoreboard players set @e healthbar 16 {Health:16s}
  10.  
  11. etc etc...
  12.  
  13. 3. set entitydata name to health level
  14. /entitydata @e[score_healthbar_min=20,score_healthbar=20] {CustomName:"♥♥♥♥♥♥♥♥♥♥"}
  15. /entitydata @e[score_healthbar_min=18,score_healthbar=19] {CustomName:"♥♥♥♥♥♥♥♥♥♡"}
  16. /entitydata @e[score_healthbar_min=16,score_healthbar=17] {CustomName:"♥♥♥♥♥♥♥♥♡♡"}
  17. /entitydata @e[score_healthbar_min=14,score_healthbar=15] {CustomName:"♥♥♥♥♥♥♥♡♡♡"}
  18.  
  19. etc etc etc
  20.  
  21. 4. Reset scores with each tick
  22. /scoreboard players reset * healthbar
  23.  
  24. http://www.dragnoz.com
  25. http://www.youtube.com/user/dragnoz
Advertisement
Add Comment
Please, Sign In to add comment