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.
execute
a valid command keyword? Have you added/
at the beginning? All command require a/
at the beginning, regardless if it's in the chat log or in a command block.execute
is a valid command since 1.8, and I'm sure I've got the syntax right. Error is just a genericFailed to execute '/testfor @p[r=2,score_hasBanner=0,team=!blue]' as Heads Up
execute @e[name=<name>...
?