Using a @a[score_test=0] argument doesn't affect players that have been reset with the "/scoreboard players reset <players>" command.
*What I expected to happen was*
The reset players would be considered as having a score of 0 and be affected by commands that use the @a[score_test=0] argument.
*What actually happened was*
they are not affected by the commands
*Steps to Reproduce* (example used in attached file)
1. create a scoreboard objective (/scoreboard objectives add test dummy)
2. set two commands on a clock
Bottom: tell @a[score_test=0] testing
Top: scoreboard players set @a[score_test=0] test 1
3. when using the (scoreboard players set @a test 0) the commands do what they should. saying "testing" and setting your test score to 1.
4. when reseting the score (scoreboard players reset @a) the commands does not affect you.
Linked issues
is duplicated by 11
relates to 2
Attachments
Comments 26
Image 1: Showing two players online, one has no value for the ones objective, the other has 0.
Image 2: Showing the command to be executed "/scoreboard players set @a[score_ones=0] ones 1"
Image 3: Showing the results. The player with 0 in ones was set to 1. The player with no value for ones was not set.
Related to MC-51330 ?
This behaviour may be intended, @unknown wrote in MC-50145:
Use "/scoreboard players reset * score" instead of "/scoreboard players set * score 0" to remove scores from the players.
???
Because
the reset subcommand removes a score from a player completely. this is not the same as setting it to 0 using the scoreboard player set command.
or with other words: Because @unknown coded this to work that way.
Then it would be null... I guess
Each class variable, instance variable, or array component is initialized with a default value when it is created:
For all reference types, the default value is null.
http://stackoverflow.com/questions/2707322/what-is-null-in-java
It would be nice if we could test for a null score, like we can with teams:
@a[score_objective=]
In the meantime (or if it never happens), I have a workaround.
/scoreboard players set @a nullObjective 1
/scoreboard players reset @a[score_objective_min=0] nullObjective
Now, all players who have a null score for "objective" will have a score of 1 for "nullObjective".
The two commands must be run in the order listed, and both must be run before any command blocks looking for a player with a score of 1 for "nullObjective".
Environment: Mac OSX 10.9.2 Java 7 update 51
I believe this is the same as the bug I'm experiencing. Here's another way to explain it:
In previous versions (confirmed in 1.7.5), executing the command "/scoreboard players set @a[score_ones=0] ones 1" would set all online players with score 0 or less AND all players who were not on the ones scoreboard.
in 14w10c, the same command only sets the score for players who are already on that scoreboard.