mojira.dev
MC-307125

Selector with multiple team conditions fails when team=!Y is placed after team=X

When using a target selector with two team conditions—one inclusive (team=X) and one exclusive (team=!Y)—the selector fails to match players if the exclusive condition appears after the inclusive one, even though both conditions together are logically valid.

Steps to reproduce

  1. Create a blank world and open the chat.

  2. 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 result
Both 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.

Actual result

  • The first selector /say @a[team=!Y,team=X] correctly displays the player(s).

  • The second selector (@a[team=X,team=!Y]) fails to execute, returning the error:
    Option 'team' isn't applicable here

Attachments

Comments 1

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, so team=X is exhaustive.

Ben Ben

(Unassigned)

Unconfirmed

(Unassigned)

26.1

Retrieved