mojira.dev
MC-101958

When using the same target selector argument multiple times, only the last argument will be used.

When using the same target selector argument multiple times, only the last argument is used in the target selector, the others are ignored. For example, when using the following target selector:

@a[tag=a,tag=b,tag=c]

Only the last tag argument is used, the other two are ignored. So this target selector will only target players with the tag c, regardless if they have either of the tags a or b.

What I expected to happen was...:
Using the same type of target selector argument multiple times would use them all while targeting entities. So the target selector in the example above would target all players that have the tags a, b and c.

What actually happened was...:
Using the same type of target selector argument multiple times only uses the last argument, the others are ignored. So the target selector in the example will only target players with the tag c, regardless if they have either of the tags a or b.

Steps to Reproduce:
1. Give yourselves the tags a and b using the following two commands:

/scoreboard players tag @p add a
/scoreboard players tag @p add b

2. Use the following command to see if you have the tags a and b. Notice that it finds you:

/testfor @p[tag=a,tag=b]

3. Remove the tag a from yourselves using this command:

/scoreboard players tag @p remove a

4. Repeat step 2 and notice that it finds you, while you don't have the tag a.
5. Remove the tag b from yourselves using this command:

/scoreboard players tag @p remove b

6. Repeat step 2 and notice that it doesn't find you.

7. Give yourselves the tag a again using the following command:

/scoreboard players tag @p add a

8. Repeat step 2 and notice that it doesn't find you.

9. Notice that it doesn't matter whether or not you have the tag a, it only finds you if you have the tag b.

Linked issues

Comments 1

This is sadly the intended behaviour, see MC-86686

JochCool

(Unassigned)

Unconfirmed

Minecraft 1.9.4

Retrieved