-1

I'm working on a one-command creation that adds sports to Minecraft. I want to be able to testfor when you kill an ArmorStand. I tried to use the scoreboard command but it cannot be used for testing ArmorStand kills.
So, how do I testfor when a player kills an ArmorStand?

1

You could try summoning an invisible ArmorStand named "Rudolf" at every visible ArmorStand, then tesing if it has another on next to it:

Plug this into a RS clock (or use the 1.9 Command blocks):

/execute @e[type=ArmorStand] ~ ~ ~ /testfor @e[type=ArmorStand,name=Rudolf,c=2]

If the testfor doesn't find anything, execute this command:

 /execute @e[type=ArmorStand] ~ ~ ~ /summon ArmorStand ~ ~ ~ {Invisible:1,CustomName:"Rudolf"}

Then, connect this command into a RS clock (or use the 1.9 Command blocks):

/execute @e[name=Rudolf] ~ ~ ~ /testfor @e[type=ArmorStand,name=!Rudolf,c=2]

If the testfor doesn't find anything, execute these commands:

/YOURCOMMAND(S)

/kill @e[name=Rudolf]

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.