Open somofnut opened 2 weeks ago
Update skript to 2.9.4, the %number% ^ %number%
use to cap at Long.MAX_VALUE
does that mean if i update to skript 2.9.4 i can use numbers above 9.223 Qi?
I have updated the plugin to 2.9.4 but the bug still occurs. I think im just gonna downgrade to the version which worked perfectly fine with numbers above 9.223 qi until they do something about it
The issue is that your strength value is a Long (capped at 9,223,372,036,854,775,807) while the other value you are talking about is the max value for a Double. Adding a decimal to the number seems to be fixing the issue. The image below is from Skript 2.9.4 but I don't think version will matter
Also keep in mind that you will lose precision when you do this. If you want precision you should use the BigInteger class with skript-reflect
Sorry folks this is actually a bug and should be fixed! It's due to Skript's number arithmetic not handling integer overflows. It should naturally switch to a double if a long isn't big enough, but it doesn't do those checks.
Thanks for noticing my bug report as i have not really seen anyone else report this exact bug so im happy to know that i may be able to use newer skript versions for my SPTS game, instead of 2.7.3.
Skript/Server Version
Bug Description
I’ve created a superpower training simulator server on my PC, using the Feather client on Minecraft 1.20.4. However, I’ve run into an issue with stat gains. Whenever any of the stats reach the 64-bit integer limit (around 9.223 quintillion), the number turns negative and won’t increase beyond that limit.
I’m running Windows 11, and I believe it’s a 64-bit version (though I’m not sure of the specific edition). I’m wondering if the issue is related to this, because I haven’t seen others reporting the same problem. This bug only occurs when using later versions of Skript, Like the 2.8 and 2.9 versions. In earlier versions (2.6.x or 2.7.x), I was able to reach numbers as large as 1.79e308, which leads me to believe that something changed in Skript that limits numbers to the maximum value allowed by my PC’s architecture (the 64-bit limit).
Expected Behavior
Previously, in Skript versions 2.6.x or 2.7.x, variables could reach numbers as large as 1.79e308 (the limit of a double-precision floating-point number). However, in the current version, numbers using variables should continue to increment beyond the 64-bit integer limit, without turning negative or being restricted to the 64-bit integer range. The expectation is that the system should handle large numbers properly, similar to how it worked in the earlier Skript versions, where values could exceed the 64-bit integer limit and reach extremely large numbers. As mentioned in the bug description section.
Steps to Reproduce
Really no code is required to be shown as it is with every single variable i use. I can try to send a screenshot. If screenshot doesnt work, i can explain whats on the picture as steps to reproduce are just to add a huge number to another huge number to achieve the -9.223 Qi stuff. The screenshot shows red text saying "+-9.22Qi Strength".
Errors or Screenshots
Other
I hope i explained everything as much as i could, as this is my first time writing a report for skript.
Agreement