Posted April 22, 20223 yr I am trying to make a mod that you can trade time you have played from the time played stats for loot bags or in game currency. This will be for a server. I am struggling to get the a players Statistics for minecraft:play_time or PLAY_TIME or stat.playOneMinute. I am just so confused and I have been looking for hours of what code to use. i tried to use this : playertime = ((EntityPlayer)entity).func_147099_x().writeStat(StatList.minutesPlayedStat); func_147099_x(). is a deprecated API I think. I also tried importing and using the net.minecraft.entity.player.ServerPlayerEntity class getStats() but that results in an error saying that it cant find it. i know i would also need a way to update the player's time played stats but just a command might work.
April 22, 20223 yr Author Thanks. I am pretty sure I just went on an adventure through the history of code for players sats today....... I also just realized I was coding in for 1.12 instead of my set up for 1.18.2 , its been one of those days.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.