When a target selector contains two team arguments—one inclusive and one exclusive—the command should fail to parse, because an entity cannot belong to two teams. Currently, parsing succeeds when the exclusive condition appears before the inclusive one, and incorrectly matches players.
Steps to reproduce
Create a blank world and open the chat.
Run the following commands in order:
/team add X/team join X/team add Y(do not join this team)/say @a[team=!Y,team=X]/say @a[team=X,team=!Y]
Expected resultBoth commands should output the player(s) in team X who are not in team Y (i.e., the same set). The order of the team conditions should not affect the result.
Both commands should fail to parse, just as duplicate type= or name= arguments do.
Actual result
The first selector (
@a[team=!Y,team=X]) executes without an error and outputs player(s) (incorrect behavior).The second selector (
@a[team=X,team=!Y]) fails to execute and returns the error:Option 'team' isn't applicable here
Linked issues
relates to 1
Attachments
Comments 3
Thank you for the explanation. I now understand that entities can only be on one team, so team=X is exhaustive—just like type—and any additional team argument after it should be rejected.
However, the issue I’m trying to highlight is the inconsistency in how the parser handles the order. Currently:
@a[team=!Y,team=X](exhaustiveteam=Xcomes second) does not reject the duplicate argument and incorrectly matches players.@a[team=X,team=!Y](exhaustiveteam=Xcomes first) correctly rejects withOption 'team' isn't applicable here.
Since the exhaustive condition determines that no further team arguments can be meaningful, the command should fail regardless of which order the arguments appear in. The current behavior treats the two orders differently, which seems like a parser inconsistency.
This works as intended. It’s the same with
type. The first argument that is exhaustive prevents future arguments from having any meaning, so they are rejected. Note that entities can only be on one team, soteam=Xis exhaustive.