Hi, I'm working with a mod which works with numbers above the max int of 2147483647. lets say a player had exactly 2 times that amount. I'd want the scoreboard to say they have passed that mark 2 times, but then lets say they get another 100k id want the scoreboard to also show that they are 100k into that current 2147483647
Scoreboards can only store Ints (whole number values from -2,147,483,648 to 2,147,483,647 inclusive). With /data, however, you can store Doubles, Longs, etc.
With that information, One solution is to simply scale down all numbers. For example, instead of storing a value of 4294967294 (2x the max value of an Int), you would store a value of (4294967294 / 10). That would allow you to store a number 10x as large, at the cost of slight precision loss.
Another option would simply be to keep track of how many times they have reached the max value. Add 1 to some scoreboard objective, then if the value is the max value, add one to a "tracker" objective. So if their tracker objective is 5, and their normal objective is 100,000, they have a true score of 10,737,518,235.
Working with /data is the most versatile, but likely the most complicated as well. You will need a lot of logic to properly compute and transfer values to and from storage and the scoreboard. Datapacks and macros would be a big help here.
Remember that scoreboard display names now exist, which may help with formatting no matter what option you choose.
Here are the basic commands for transferring data between storage and scoreboard:
/scoreboard objectives add math dummy
/execute store result storage math player1 double 1 run scoreboard players get @s math
/execute store result score @s math run data get storage minecraft:math player1
This isn't necessarily the most detailed response but there aren't many specifics to go off. Hopefully, this gives you a good place to start!
Hi, I'm working with a mod which works with numbers above the max int of 2147483647. lets say a player had exactly 2 times that amount. I'd want the scoreboard to say they have passed that mark 2 times, but then lets say they get another 100k id want the scoreboard to also show that they are 100k into that current 2147483647
Sorry if this doesn't make sense
Hello,
Scoreboards can only store Ints (whole number values from -2,147,483,648 to 2,147,483,647 inclusive). With /data, however, you can store Doubles, Longs, etc.
With that information, One solution is to simply scale down all numbers. For example, instead of storing a value of 4294967294 (2x the max value of an Int), you would store a value of (4294967294 / 10). That would allow you to store a number 10x as large, at the cost of slight precision loss.
Another option would simply be to keep track of how many times they have reached the max value. Add 1 to some scoreboard objective, then if the value is the max value, add one to a "tracker" objective. So if their tracker objective is 5, and their normal objective is 100,000, they have a true score of 10,737,518,235.
Working with /data is the most versatile, but likely the most complicated as well. You will need a lot of logic to properly compute and transfer values to and from storage and the scoreboard. Datapacks and macros would be a big help here.
Remember that scoreboard display names now exist, which may help with formatting no matter what option you choose.
Here are the basic commands for transferring data between storage and scoreboard:
This isn't necessarily the most detailed response but there aren't many specifics to go off. Hopefully, this gives you a good place to start!
-TechnoBro03