When using @p or @r Command Stats works and with @a it works only when there's only 1 person on the server...
I tried it only with SuccessCount but I think the problem exist with the others as well...
Steps to reproduce:
1. Be on a server with 2 players or more
2. Make a new objective, For example "Objective": "/scoreboard objectives add Objective dummy"
3. Set the objective to 0 for all of the players: "/scoreboard players set @a Objective 0"
4. Make another Objective: "/scoreboard objectives add Objective2 dummy"
5. Make a command block on a clock to test for the seconds objective: "/scoreboard players test Main Objective2 1 1"
6. Make the Command Stats for it: "/stat block x y z set SuccessCount @a Objective"
7. Make the first objective on the sidebar to see it: "/scoreboard objectives setdisplay sidebar Objective"
8. Set the second objective: "/scoreboard players set Main Objective2 1" And you'll see it won't set the players' Objective to 1 like it supposed to...
9. If one of the players would leave it will work and set his Objective to 1
10. When the player logs in the other player's objective will stay 1 but you can set it back to 0 and the command running in a clock won't set it back to 1!
I'm sorry it's too long but it's really annoying because I'm need it for my map...
Attachments
Comments 4
Tried with 1 player, 2 players and 3 players and it always was the same! More than 2 players and it didn't work and I tried it exactly like I wrote it in another superflat world (The one I sent) and it still didn't work!
This is how it's supposed to work. If you use a selector to specify a player for the result of a stat command, you have to use a selector that resolves to 1 result (Example: @a[c=1] instead of @a would work). The way to solve what you are trying to do here is to use /stat entity on players, then run the command in their context via a /execute command.
Thanks! I found another solution for my specific problem...
If you can check MC-65471 it will be helpful...
Sorry for bothering you!
We can't reproduce this issue with the steps you described. Please provide a world download that reproduces this issue.