Running the following code in a function:
I've been noticing that any time I run a testfor command that looks for data tags after a stats command, the result would sometimes be constantly wrong (usually resulting in 1)
Sometimes I can get around this by changing the scoreboards name (I did that here with Temp A, B, and C, they were originally another scoreboard) but I noticed the problem persists if you try to perform an operation on the scoreboard after acquiring the stats.
e.g. the code:
TempC was not used, but this resulted in -1
it was then changed to:
This resulted in 0
I then changed it to:
This resulted in 1.
based on this, it appears TempA and TempB are both set to 1 regardless of what the stats result is, however the result of this function is:
Dims # (Changes depending on how many people are online and in the overworld)
Sleeps # (Changes depending on how many people are in bed)
Delta 1 (always returns 1 even though it should return the difference between the two numbers)
before I switched scoreboards, both Dims and Sleeps returned 1 as well
This tells me that you can use the scoreboard in a selector and in tellraw, and it returns the true value, but using it in a scoreboard operation returns 1.
The function is located at gm4:modules/better_beds/state/5
Hopefully this is enough information to recreate the problem.
I know this is a problem because I've encountered this numerous times and have also seen many people encounter it as well. reloading or restarting the game doesn't fix this, nor does removing and re-adding the scoreboard objective.
Please thoroughly investigate, as this problem affects a lot of my functions and I would like for it to be resolved!
functions folder available upon request