Selectors not working with scores of offline players
If Entity does not have a score in a scoreboard and is used with selector (@a,@p,@r,@e) it will not be successful.
Eg.
testfor @p[score_test=0] does not work if player has not been set to 0 already. or
testfor @a[score_test_min=10] but player has not been set or just logged into the world for first time it does not work
Linked Issues
Created Issue:
Selectors not working with scores
If Entity does not have a score in a scoreboard and is used with selector (@a,@p,@r,@e) it will not be successful.
Eg.
testfor @p[score_test=0] does not work if player has not been set to 0 already. or
testfor @a[score_test_min=10] but player has not been set or just logged into the world for first time it does not work
Selectors not working with scores of offline players
relates to
is duplicated by
is duplicated by
A comment with security level 'global-moderators' was removed.
Related to MC-51330 ?
score_test=0 selects all player having 0 or less points
score_test_min=10 selects all player 10 or more points
What Luke means is if a player hasn't joined yet, their score wont register as being 0, and therefore will not be picked up by the command blocks. If they joined and were set to -1 first, then 0, it works as intended.
LTDR/Too rambly:
The game's default default score doesn't register players properly, and therefore can't be tracked unless added manually with quirky work arounds.
Reopened. Please provide exact steps to reproduce and edit the summary of this ticket appropriately.
/scoreboard objectives add playerID dummy
/scoreboard objectives add nextPlayerID dummy
/scoreboard players set DUMMYPLAYER nextPlayerID 1
Place a command block:
Fill it with: /scoreboard players operation @p[score_playerID=0] playerID += DUMMYPLAYER nextPlayerID
Place a comparator out of that command block.
Place a command block after the comparator:
Fill it with: /scoreboard players add DUMMY_PLAYER nextPlayerID 1
The problem lies in the fact that the selector "@p[score_playerID=0]" never selects a player to use the operation on. By default, any score is initialized as 0.
What should happen is, it will take the nearest player's "playerID score" and add the "nextPlayerID score" to it, as long as it's 0. Afterwards it adds 1 to the "nextPlayerID score" so it is always unique per cycle.
This doesn't work because of the selector fail.
This seems to happen either if the objective is new (added since 14w11a), or if the player is new - but I'm having a hard time recreating the issue, it seems to sometimes occur at random points; a player may have valid scores one login, but invalid scores the next[?]
It's notable that if you do a simple [EDITED]:
/scoreboard objectives add myObjective dummy
[should default all players to 0]
/say @a[score_myObjective_min=0]
[returns no players; expected all online players to be listed]
/say @a[score_myObjective=0]
[also returns no players; expected all online players to be listed]
You will find that the player(s) this may have affected will not show up for either /say, meaning they either have no score, or an invalid score in the scoreboard.
If I can find clearer steps to reproduce, I'll edit this post.
EDIT: Seems just creating brand-new objectives does the trick, but I don't know how this bug applies to previously-created objectives (even though it seems to have some effect).
ALSO:
This bug may be related to: https://bugs.mojang.com/browse/MC-50601
I can confirm this, as i have a welcome msg setup for new users with a score in status of 0 which hasnt been working and dosent trigger except when manually setting a users score to 0 in that objective
This report needs updating; the bug is still present in the newest of these snapshots, too (14w17a, 14w18b, and 14w19a).
When i use something similar i get an error saying "That player cannot be found" using the below in a cb
say Welcome @a[score_status=0] !
When you create a random score '/scoreboard objectives add randomscore dummy', then type '/scoreboard players reset @a' and then run a test command '/say @a[score_randomscore=0]' no players will be found.
I'm assuming it is because the player hasn't actually been given a score of 0 on that objective yet ('/scoreboard players set @a randomscore 0'), but in my opinion all players that haven't been given a score of 0 should begin with a score of 0.
This used to work in Minecraft 1.7.4 and below, but not 1.7.5+ (including the snapshots). Please fix this; it is the best way to detect players joining maps for the first time and easily set their spawnpoint/display a message.
I'm not going to vote for this since it is not an issue. If the score is not set, there is no value for the scoreboard entry. And so you cant check if the score is higher than zero.
Imagine checking for the background color of a picture that does not exist. You ca just set the score to 0, and it will be registered as 0 from that point, although it does not show up in the tracker yet. Apart from not showing p in the tracker, it should work as intended.
I know this is a very unnatural feeling, but it has to do with the way you program stuff. Fixing this issue would have to create a new entry in your save file for every entry for every entity. That does not only make your file size bigger, but also lags your game.
I have one question, from what I read in the description I would say it is a duplicate of
MC-50601but it seems like the title has nothing to do with the description, could this be possible?Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.
Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been delivered.
Ticket resolved as incomplete, because no answer in a reasonable amount of time (1+ year), if it still happens, please update the ticket.
I can confirm this still occurs on 1.11x and Snapshot
Resolving as intended: It's illogical to be able to select an entity that isn't anywhere in existance.
The issue is that this used to be able to be done, but at some point 1.8 i think it was this ceased to be able to be done
You still can with scoreboard players test.
Then you test for the score.
With a selector you try to select an entity.
In order to select or test for something it needs to exist, the difference here is wheather you select the score or the entity (score exists, entity doesn't).