This is a very niche problem but a few people I know and myself are about to hit the 32 bit int limit of playtime and some of the other "time" stats and rather than going into our stats and setting them back down to 0 so we can keep track of our playtime it would be a lot easier to have a mod to just let the number count higher. Not sure how simple or hard making a mod to do that would be though
#64 bit "Time" stat
175 messages · Page 1 of 1 (latest)
At a glance, it looks like it's pretty solidly an integer. A hacky fix wouldn't been too difficult - add another stat for "Time Played Overflow"
Oh that's a while back
Though stats are not really a thing that I've heard of being touched that often
I mean the most preferable option would just to have the same stat continue to count up, I think another issue might arise when changing versions if it would reset down to the normal 32 bit int limit again
*updating versions
it is def a very very niche problem
If you want, I can try a more technical explaination of what it would require
sure, thought I'm not a coder so I might not understand it all
I know that the "time" stats are counted in ticks
if it was possible to convert ticks to seconds then start storing that data it would be more than enough
but I assume that would add some loss if you were in the middle of a second, unless you kept the tick you disconnected at stored somewhere
That's clever, and might be more doable
That would be a pain tbh xd
yeahh
I mean it might go something like second = tick x 20 and then tick is just stored somewhere
because the ticks are always counted and stored into the time played
Basically, programs remember stuff while they're running in a variable.
Java likes to know what type of stuff is stored in a variable - even before you run the program.
Changing it from an int (to a long, for example) would mean changing all the types involved for lots of different things, all while the game is running.
But I just got an idea
I might be able to finagle it to last for 14610000000 years
Java uses signed integers - postive and negative numbers. That means about half the possible numbers are negative.
What If I just stole those xd
wouldn't that just double the normal int limit?
Let's do an analogy - Say you've got a display that can show you numbers. It can only show you one number. That means 10 different numbers - 0-9
Then, you double the number of digits it can hold
100 different numbers - 00 - 99
so it would be like a magnitude more essentially
We're doing the same thing, but with 2 digits instead of 10
Essentially, yeah
Many binary orders of magnitude
For about 6x
Let me do some more research
I think 14.6 billion years might be enough time then
they'll release earth 2 before I run out of time
Oh it's actually a 32-bit limit. So going from 40.86 months to 81.72 months
Still, that's decent
Oh yeah 🤦♂️
We're only getting one more digit, the sign
And in binary, that means 0 or 1
which doubles it
I mean it would give me another 3.5 years to figure out a solution lmfao
rn I have ~130 days before I hit the limit
and one of my friends already hit it
I'm getting the source code for 1.17.1 rn, hopefully it's not too different from 1.21.5 in the stats department
I assume it would be exactly the same other than a few new stats added for new stuff
That's the hope. You'd be surprised though, things change a lot.

Gimme a while, I'll ping you if there's news
<3
I don't know how practical it would be, but could you change it to be a long instead of an int? I haven't done anything with the stats menu but I would assume it can be done with a single mixin
I don't think you can change it to be a long instead of an int, but you could create a different variable that is a long and mixin into all usages of that int to use your own variable instead
Not without ASM. Rime's method would work, but would also be annoying to do.
ok yeah that makes sense I should probably get more sleep lol
I did make a mod like this a while back on the ornithe toolxhain using fabric for 1.12 I won't have time to port soon, but maybe in 3 or 4 weeks. I always wanted to port it to more versions. It has 64bit scoreboards and stats, it displays them in-game and still allow vanilla clients to connect to the server (they see the downcasted value, modded client is required to see the 64bit value). I haven't had time to release but I can make the code public tomorrow when I am at my pc if someone else is interested in porting before I find the time to port it
so it just lets the stats in the stats screen count higher?
or is it a seperate scoreboard?
It makes the stats in the screen 64bit instead of 32bit
Yes but it is for 1.12 so requires porting dunno how much the relevant code changed. The same tricks and techniques I applied will probably still be useful to make the mod in 1.17, sadly I have to finish my thesis so no time for next 3 weeks or so
I have ~130 days till I reach max and since I'm in 2nd place for time played WR I think it's enough time
Aitor already hit it but he can probs just re-edit his stats back if he wants to play with the mod
Well I am good at procrastinating so if you don't remind me, I might end up forgetting/procrastinating lol
I made it when people on the TMC server that I play on started running out of elytra stat
oh I have been out of elytra stat for ~5ish years now lmao
it wouldn't be counted for a record but it would be cool to see it go back up
I guess a question I have is, if I were to use the mod and get higher than normal stats then remove the mod what would happen?
would it just go back to the int limit or would it reset or go negative?
I am honestly not sure, either the game refuses to load the world bc the storage format lf the world will be slightly different bc of 32 vs 64bit (I think this most likely)
If you want to go back you probably have to run a script to downcast the values (before using the mod you need to run a script that converts the world too, dunno how hard this to integrate into he mod with datafixer)
are the values stored in the normal stats file?
Yes that file gets changed
well I'm very excited to see stats that haven't changed in over 5 years finally go up :D
soon™
I can’t tell if anyone already agreed to make the mod but I can take a look at implementing this!
pretty sure dragon already made the mod for 1.12 but has yet to port it to newer versions
I'm working on it rn
At least kind of
I'm making it use all of int, not migrating to a long
Honestly might yoink the feature for my utility mod
It would go negative
The way I'm doing it at least
It would fail to load if it was converted to a long
I'm just worried about updating to a newer version and something going wrong, though I do always make backups beforehand obv
I assume it'll all be fine but u can never be too careful lmao
Fair. I don't know how it would handle it, but unless stats change, it should be fine (assuming the mod is present on the new version too)
My guess (even though I don’t have any code) is that it would roll into the negatives, which if you have the infrastructure for, can be recovered into their correct values.
Yep, as long as the codecs are OK with it
I wonder if I would have maxed out the 64 bit int limit of elyra yet
nevermind I just realized how much bigger the 64 int is than the 32 bit lmfao
Got an approximate flying speed for me?
well I maxed it out within the first year of playing
I mean like m/s or blocks/second
and just in the past 4 months I've used ~2 years worth of rockets
yeah lol
on avg I think flying speed is like 50 bps
actually 50 is on the high end
I'd say 40-45 is more avg
hmm, so what ur saying is I'd be close
3 years is pretty close to 7.5 million years imo
Very 
7.8 times 7.5mil
I love wolfram alpha
yeah cm?
ah
Or rather wolfram did
cuz 58.5 mil / 100 is totally more attainable than just 58.5 mil years
next goal is 64 bit int of cake eaten
Fun!
@void kayak I'm done! Jar is attached - no Fabric API required, but it does need Loader 0.17.0+. Technically would work server-side, but clients would see negative numbers for stats I think, so put it client-side too. I can make a repo on GitHub if you want proof that the jar was compiled from the sources I published.
@plucky kettle Sources at https://codeberg.org/skycatminepokie/stat-extender, you don't need to credit or include the MIT license.
https://github.com/BismuthServer/LongScoreStat/tree/dev
This is the 64bit implementation for 1.12 (feel free to port if anyone wants to, otherwise I will do it myself in a few weeks when I have time)
Tysm!
:0
have u gotten any time to port this over?
No, I will have some time from Friday onwards so then I can start porting
ty <3
any updates on this?
How does even manage this
Well, it's a signed int and in ticks, so it's not bad.
I mean the 3 years in a single Minecraft world
Play a lot
Not much yet, getting slowly into it, explored the 17 code a bit to see what is different
Needed some time to touch some grass after being locked in for so long on masterthesis 😅
Porting this is a vibe, started on 101 errors, still on 101 errors after fixing several files 😅
fix one bug and 10 more pop up
well it is going quit okay, I am ignoring scoreboards for now and focussing on stats. Mainly have the GUI stuff left and making sure everything works
Only interested in the stats or also scoreboard? Now I am onto testing phase and seeing if the stuff I wrote actually works now the client boots again
just the stats on the stats screen
I don't use any scoreboard mods
good, I will leave the scoreboards for what it is then, I don't play this version so I won't put effort into it if nobody needs it
gotta need to do some serious debugging, it fails to generate a world lmao

Heck the datapacks xd
This is something I didn't have to care for in 1.12 and fixing the stat interaction with datapacks will be a nightmare
Don't they have to use scoreboards?
If you can just make it look like it's vanilla for datapacks, no damage done
They seem to exist for both scoreboard and stat?
What do they have to access stats directly?
well I probs gonna down cast to int for now and see if the rest works
Yeah that's my thought
idk, I have no clue what datapacks are or what they do, but wiki says you can test on the player statistics
can see if the value for a certain stat is within a range
Datapacks are purely json files and commands.
StatHandler statHandler = serverPlayerEntity.getStatHandler();
for (Entry<Stat<?>, NumberRange.IntRange> entry : this.stats.entrySet()) {
int i = statHandler.getStat((Stat<?>)entry.getKey());
if (!((NumberRange.IntRange)entry.getValue()).test(i)) {
return false;
}
}
You have this check in test function in PlayerPredicate and wiki metions it too https://minecraft.wiki/w/Predicate
Minecraft Wiki
Predicates are JSON structures found in multiple different locations within data packs. They are invoked with various means to check conditions within the world. They return a pass or fail result to the invoker, who acts differently based on this result.
Predicate files are standalone data pack files that contain one or more predicates. Predicat...
something funny going on
gaming
I did a very big opsie in the code for this to happen lol
everything seems to work correctly