I'm working on a capture the flag minicame in Minecraft 1.8.1. One of the features is automatically picking up flags when a valid player is in range. To accomplish this, I placed an armor stand inside each flag.
The goal is to get that armor stand to test for valid players (i.e. not on the same team, doesn't already have a flag, etc.) and set the block that was the banner to air. Each flag has a certain rotation value that is used to tell what team it represents – in this case, a rotation (ry
and rym
in the command) of 0 means the blue team. So, this command should tell all armor stands with a rotation of 0 to check for players not on the blue team who don't already have a banner.
Here's the command that isn't working:
execute @e[type=ArmorStand,ry=0,rym=0] ~ ~ ~ testfor @p[r=2,score_hasBanner=0,team=!blue]
And here's the error: Failed to execute '/testfor @p[r=2,score_hasBanner=0,team=!blue]' as Heads Up
("Heads Up" is the custom name of the armor stand, don't worry about why)
This error tells me that the execute
command must be working fine, meaning it's a problem with the testfor
command. However, using the testfor
part on its own works perfectly.
Any ideas? Thanks in advance.
Best Answer
The command itself is completely fine, and works for me:
Make sure: