So, I am doing a little Minecraft adventure map and the number one thing I keep getting stuck on is how to execute a command block once a zombie hits you three times. Thanks! :D

  • 1
    nothing and i dont now if this is possible! – user144609 May 21 '16 at 11:51

It's possible, but not 100% reliable. You want to repeatedly testfor a Zombie in less then 1 block from a Player (hitting distance) 3x:

/execute @e[type=Zombie] ~ ~ ~ testfor @a[r=1]

Or the other way around: /execute @a ~ ~ ~ testfor @e[type=Zombie, r=1]

1) Put one of these commands into a Command block with a Comparator facing out of it.

2) Then, use a Redstone impulse lengthener as shown below to lengthen the signal to like 10 seconds.

3) Add a Piston that allows a clock to repeatedly trigger a Command block.

4) This Command blog should have the same command as above.

5) Repeat this one time more and you got it done.

6) Add a fourth CMD block at the end with you own command.

Redstone signal lengthener:

(Instead of "door" use "Next Command block")

  • @kevinbestkiller Feel free to hit the checkmark next to this post if it helped you! – RudolfJelin Oct 9 '16 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy