Testing For A Mob With Less than "x" Hearts

Testing For A Mob With Less than "x" Hearts - Person Writing While Using Phone

I am making a boss battle, and the boss has a few different stages already implemented, I just need a detector to tell the stages when to activate. To activate the final stage, I want the mob to have less than 20 half hearts, and I try to test that with this command:

/testfor @e[type=Zombie,name=Joe,score_bossHealth_min=1,score_bossHealth_max=20]

However it does not seem to find the mob. In case I'm changing the wrong thing, this post refers to the only other variable that could be affected/affect the mob. Did I make an error in the syntax?



Best Answer

Yes, you made an error in the syntax. score_health_max in an invalid argument. Use score_health instead:

/testfor @e[type=Zombie,name=Joe,score_bossHealth_min=1,score_bossHealth=20]

That should work.
Also, you can (if you don't have another Joe) remove the type=Zombie.




Pictures about "Testing For A Mob With Less than "x" Hearts"

Testing For A Mob With Less than "x" Hearts - Photo Of Female Engineer Working On Her Workspace
Testing For A Mob With Less than "x" Hearts - Photo Of Female Engineer Looking Through Wires
Testing For A Mob With Less than "x" Hearts - Happy Valentine's Day Card





Testing Scary Minecraft Myths That Are Actually True




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Pew Nguyen, ThisIsEngineering, ThisIsEngineering, RODNAE Productions