Started by
GeantPiste
on
Topic category: Help with modding (Java Edition)
Hello, I'm creating a mod where I want to add custom advancements. So I want to give an advancement to any player who played 100 hours. I don't know how to get player's statistics and i didn't find anything helpful on internet. Can someone help me please ?
Hello, first create a variable that applies only to the player, then you need to create a procedure that triggers every tick of the player. In the procedure, add 0.05 to the variable (since there are 20 ticks in one second, hence 0.05). As a result, you have a variable that counts the game seconds for each player. From there, you can work with it however you like.