Entity Health Bar using Entitydata

Entity Health Bar using Entitydata


1. Setup scoreboard
/scoreboard objectives add healthbar dummy

2. Set scoreboard based on health
/scoreboard players set @e healthbar 20 {Health:20s}
/scoreboard players set @e healthbar 18 {Health:19s}
/scoreboard players set @e healthbar 18 {Health:18s}
/scoreboard players set @e healthbar 16 {Health:17s}
/scoreboard players set @e healthbar 16 {Health:16s}

etc etc...

3. set entitydata name to health level
/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:"♥♥♥♥♥♥♥♡♡♡"}

etc etc etc

4. Reset scores with each tick
/scoreboard players reset * healthbar

http://www.dragnoz.com
http://www.youtube.com/user/dragnoz

No comments:

Post a Comment