mojira.dev
MC-73737

Asterisks can't use selector arguments

Asterisks function differently than regular selectors. If you attempt to use arguments after the asterisk, the game will simply read them as part of the player name.

To replicate, create a scoreboard objective called "test". Set your value in that objective to 1. Then type

scoreboard players reset *[score_test=1]

It will reset the scores of the player "*[score_test=1]". Your score will not be reset.

Linked issues

Attachments

Comments 10

you have to use @p, @a, or @r, not *

You are incorrect. "*" can be used to indicate all entities tracked by the scoreboard.

I think not, try using @e instead of "*"

I really wish people would know what they were talking about before posting. "@e" selects all entities, "*" selects all entities tracked by the scoreboard. There is a difference.

i don't think you can have things like [] after the asterick then

why can't you just use @a[score_test=1] because if they have a score for objective test, they are definitely tracked by the objective, so this bug shouldn't matter.

I'm aware that you can't have arguments after asterisks, that's why I posted it on the bug tracker. Whether the bug actually gets in the way is irrelevant, it is still a bug. And "@a[score_test=1]" won't work anyway, since there might be more than one objective.

If my understanding is correct, the bug is that it thinks *[score_test=1] is a player name.
Besides that, it might help to know what you are trying to accomplish with the command.

Would you mind explaining this resolution Searge? Why should asterisks behave differently than other selectors?

The asterisk isn't a selector, it's an argument which only the scoreboard command understands. Just because it can take it in place of a selector doesn't make it a selector. It refers to the scoreboard data directly, whereas selectors refer to some subset of all loaded entities. Giving it the full filtering capability of a selector would require either duplicating the selector code (bad for maintainability) or refactoring the selector code to handle the scoreboard/asterisk context. Various scoreboard and selector decisions are constrained by performance considerations, because they are expected to be run on a large data set at high frequency. Like many commands, they operate very close to the internal game logic, and thus aren't expected to be much prettier than the underlying code.

KingSupernova

michael

Unconfirmed

Minecraft 1.8.1-pre3

Retrieved