When a specific score is divided by 10 and assigned to storage, a different number is assigned.
Step1: Create a score
"/scoreboard objectives add distance dummy"
Step2:Assigning specific scores to players
"/scoreboard players set Test distance 121"
Step3:Divide the score by 10 and allocate storage
"/execute store result storage distance distance double 0.1 run scoreboard players get Test distance"
Step4:Check the number in the storage
"/data get storage minecraft:distance"
In the video and this example, we used double type, but we have confirmed a similar phenomenon with float type.
This means the distance cannot be displayed. Waiting for a workaround or bug fix.
(Use Google Translate)
Attachments
Comments 3
Can confirm. I modified steps to reproduce slightly, so it would be easier to copy commands 🙂
Steps to reproduce:
Create a score.
/scoreboard objectives add distance dummy
Assign a value to player.
/scoreboard players set Test distance 121
Divide the score by 10 and allocate storage
/execute store result storage distance distance double 0.1 run scoreboard players get Test distance
Check the number in the storage
/data get storage minecraft:distance
Observed results:
Float precision error
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
This issue is caused by floating point imprecision.