/stats Commandblock stats SuccessCount does not update scoreboard when set to NULL (reset)
I hope this wasn't already reported, but it seems like the new command block and entity tags do not work when the score is reset, or was just created
Created Issue:
/stats Commandblock stats SuccessCount does not update scoreboard when set to NULL (reset)
I hope this wasn't already reported, but it seems like the new command block and entity tags do not work when the score is reset, or was just created
Added Labels: /stats scoreboard successCount
Added Affects Versions: 14w29b
Added Affects Versions: 14w30c
Added Affects Versions: 14w31a
Added Affects Versions: 1.8-pre2
Added Affects Versions: 1.8
Added Assignee:
[Mojang] Searge (Michael Stoyke)
Deleted Comment:
I WANT FINALLY AN EXPLANATION!
Added Attachments:
Removed Labels: NULL

Searge explain me finally what the problem is!
You could simply copy and paste code, but I don't know if you are too lazy or what yourproblem is!I will take everything I said back, if you finally explain me, what the problem is!I am sorry for beeing so rude, I really respect your work and you are doing really great, but I guess you can imagine, how it is as a player just to read "Works as intended" with no explanation. It would be really nice from you, if you could explain to me, why you cannot add/"fix" this.
I mean for teams it is working, you can test for entities without a team (/testfor @e[team=]), I guess this starts a for loop for the selected entity for all teams and tests until it returns true if there is an entry for the entity in one of the teams.
So why does this then not work for scores? -> Here is the answer it can work, but for what ever reason you don't want to implement it, and I don't get why
Arguments which proof this:
I have no idea what the bug is, please provide a proper explanation.
When you use the /stat command and use a scoreboard objective of a player who has no score there, it won't work. You have to set it to 0 first
Yeah, that's how the scoreboard works (
MC-50601). It has a value called "null" which is the same as 0, except the game doesn't recognise it as such when testing for a specific value, and if a score has that value, it will not be visible on a scoreboard display. "Null" is the default value when an objective is first created, and it will also be set as the value when the reset command is used.The bug is anyways that the /stats command doesn't act like the /scoreboard players set, but it should as it does the same thing
And I guess Null doesn't really get stored as value but Minecraft (or maybe Java in general?) return Null if no value is set.
I still don't understand what the problem is. Can you provide the exact command that isn't working?
Use for example these commands:
This should normally set your test score already to 1 else run a second command like /say Hi
But it doesn't only if you run /scoreboard players set @p test 1 it works
What I expected was that the /stats command acts like the /scoreboard players set command
The /stats command does not directly update the scoreboard, and isn't intended to. It makes it so that a block or entity updates the scoreboard when that block or entity executes a command.
Ok, I understand what you are saying now. I would certainly consider this a bug, but as usual, Mojang denies it.
How would that be a bug? Either you don't understand the /stats command, or I don't understand the bug report. Possibly both. It's really hard to tell what's going on in this report: the comments, summary, description, and attachment don't seem to have any relation to each other.
Yes, it is rather confusing. What he means is that the stat command will not update a scoreboard objective with a value of null. For example, say you have a dummy scoreboard objeective called "success" with a value of 0. You set your success count stat to output to the scoreboard objective "success" with the stat command. Now if you run the command "/testfor @a" with 2 players online, your success score will now be "2". Now a command block resets your "success" score , so it now has a value of null. In other words, you now don't have a score in the objective. If you then run the command "/testfor @a", your "success" score will not be set to 2. Does that clear things up?
The /stats command works exactly as designed, it won't set scores that are not already set to a value. Set the score to 0 before you use the /stats command and the "problem" is solved.
So is this an efficient way to stop entities from constantly being affected by stats? (I hope you understand what I mean)
If an entity has for example no score, but a stat stored, will the game first check if the objective is a value and then set the value or won't the game even test the stats for that entity when the objective is null?
What?
The point of the reset command is to remove an entry from the scoreboard so that it's no longer tracked, and thus doesn't consume processing resources. It doesn't set the score to null, it deletes it. Null is a typical return value when testing for things that don't exist, but it doesn't distinguish between "never existed", "existed but has been deleted", and "set to null". You can't operate on something that doesn't exist.
Command stats are produced in the process of running the command. Using the stats command just tells the block or entity to store the command stats somewhere, rather than throwing them away. If you want a block or entity that executes commands to stop storing a particular command stat, you use the "stats block|entity <x y z|selector> clear <stat>" command. If you want an entity's score to no longer be affected by command stats, then yes, resetting that entity's score would be a way of accomplishing that. However, it's probably more efficient to use a more precise selector. When searching a set of data, the earlier you can eliminate portions of the data, the more efficient your search will be.
That's exactly my point. Having the stats command not affect scores of null serves no point, as you could just clear the stat. Out of the two ways to affect scoreboard values (/scoreboard and /stats), why should one of them work on values of null and one of them not? It's inconsistent and requires additional command blocks to make it function the way you want it to.
There is no such thing as a null score. The reset command doesn't set a score to 0, it deletes the entry from memory. Updating an existing entry is computationally cheaper than creating a new entry, so creating new entries is restricted to certain commands. While it would be possible to do it differently, it's not worth the performance hit.
Alright, thank you