1
How do I testfor a zombie with a health of 0?
I'm working on an adventure map, and one of the things in the tutorial is you have to fight a beast (Zombie with green leather armor and oak leaves on it's head). I need to have a command that finds out when the zombie has died.
I have tried making it's armor a 100% drop chance and testing for the armor it drops because that will only come out when it dies, but that didn't work, then I tried searching the internet for a way to testfor a zombie with a health of 0 and found nothing good beside doing all that weird scoreboards and such but for one I don't want to make an entire scoreboard because of one tutorial beast and for two I have absolutely no clue how to do scoreboards. Is there a simple way to just test for if the zombies health is at 0?
I have tried making it's armor a 100% drop chance and testing for the armor it drops because that will only come out when it dies, but that didn't work, then I tried searching the internet for a way to testfor a zombie with a health of 0 and found nothing good beside doing all that weird scoreboards and such but for one I don't want to make an entire scoreboard because of one tutorial beast and for two I have absolutely no clue how to do scoreboards. Is there a simple way to just test for if the zombies health is at 0?
Create an account or sign in to comment.
4
1
It's been a while since i've made a singleplayer adventure map but you could invert the signal and test for no zombie. You'd have to only have that command block be powered after the zombie has spawned though.
1
How would you go about that? Would it be like a redstone clock that starts when the beast spawns and it is dependent upon command block that tests for the zombie, followed by a compactor, and every time the clock repeats it adds a pulse into a repeater and it goes faster than the repeater, then after the repeater do a not gate, followed by the rest of the tutorial so as soon as the command block's output is false because it can't find the zombie the clock stops and the not gates turns on the rest of the tutorial?
1
Well without trying anything in game I would do:
- When the command to spawn the zombie is triggered it also sets a redstone block near another (repeating, needs redstone) commandblock that is testing for the zombie with inverted output signal.
- Then when the zombie is killed that inverted signal is back to normal so would power an impulse command block to set that redstone block back to air and also do whatever other commands you need for the boss killing.
- When the command to spawn the zombie is triggered it also sets a redstone block near another (repeating, needs redstone) commandblock that is testing for the zombie with inverted output signal.
- Then when the zombie is killed that inverted signal is back to normal so would power an impulse command block to set that redstone block back to air and also do whatever other commands you need for the boss killing.
1
All right, I tried it and it worked, thanks for the help!