I wanted a command block argument that only outputs to players who where NOT on one particular team but also NOT on another so I applied:
@p[team=!TeamName1,team=!TeamName2]
but found that instead of working as I had intended it outputted successfully when I was on the first team listed in the argument and did not output when i was in the second.
I can confirm that I was playing in singleplayer with no other players online.
What I expected to happen was...:
For no output to occur when I was on either of the two set out teams whilst outputting successfully when I was not.
What actually happened was...:
An output occurred when I was on the first team listed in the argument and when I was on neither of the two whilst there being no output when I was on the second team listed.
Steps to Reproduce:
1. Create team Red using /scoreboard teams add Red
2. Create team Blue using /scoreboard teams add Blue
3. Create a command block with:
tell @p[team=!Red,team=!Blue] Hello
and place a button on the command block.
4.Test output when player is in no team by pressing button.
5. Join team Red using:
/scoreboard teams join Red
and press button to test output for when player is in Red team.
6. Join team Blue using:
/scoreboard teams join Blue
and press button to test output for when player is in Blue team.
Linked issues
Comments 10
Is this still a concern in the latest Minecraft version 13w48b? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
This is working as intended, currently you can't have two of the same argument, the second one will overwrite the first one. I actually recently removed this false information off of the scoreboard page on the wiki which you might have read and been confused by.
Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
Confirmed in 1.8.3. Relates to MC-75269.
@Searge
How is this intended? It serves absolutely no purpose and is completely inconsistent with the way other arguments work.
Sometimes things are intended for programming reasons, rather than because that's the desired game behavior. The code is much simpler when you know in advance exactly how many arguments it will accept.
How is this inconsistent with the way other arguments work? I thought most of them only accepted one value per selector, and the others were the exception.
The second team argument is probably overwriting the first. I've seen no indication that you can have multiple of the same argument, but equally no indication that you can't. It wouldn't make sense for some arguments (coordinates, radius, count, experience) but pretty useful for others (team, name).