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
Attachments
Comments 18
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.
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.
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:
In earlier versions it was possible to test for entites with score of 0 which returned also entities which had no score for this objective
The structure how scores and teams are saved is nearly the same (would for example the scores get saved in the player folder, I could understand why it is maybe different to add, or more complicated)