Im trying to make a wave spawn kind of thing and i would like a command block to activate its comparator redstone signal when the command blocks command is negative.

I tried this using /testfor @e[type=!Zombie] but that does not work as it detects the player or any other mob. any way to do this without a redstone torch ?


One way to do this is to have a second command block testing if the previous one failed:

Chain command block leading off of an impulse command block

The impulse command block would have your current command (/testfor @e[type=Zombie]).

The chain command block, which is the one you should run comparators/conditionals off of, would then have:

/testforblock X Y Z command_block -1 {SuccessCount:0}

X Y Z should be the coordinates of the impulse command block.

This makes the chain block succeed when the impulse block fails.

  • On some of the Command blocks i get the error " ~ ~ ~ did not have the required NBT key if you know how to fix this. I cant find a tutorial for a fix on this on a command block. only chests and hoppers. – Reflexive Nov 25 '16 at 15:19
  • @CaolanMC That error means that the testforblock failed, ie: the command block the testforblock is targeting succeeded. The error does not indicate that anything is wrong with the system. Your coordinates should be pointing to the impulse block though, not to the chain block (~ ~ ~) that's running the testforblock. – SirBenet Nov 25 '16 at 18:31
  • im sure the coordinates are right. I dont see how i could have messed up hard enough to make a chain block try and detect itself. – Reflexive Nov 25 '16 at 19:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.