Solved World Time to Realtime

Discussion in 'Spigot Plugin Development' started by KleinWunder, Jun 12, 2021.

Thread Status:
Not open for further replies.
  1. Hey!

    I am really bad at maths and can't wrap my head around what to do to convert the minecraft world time (which is between 0 and 24000 ticks) to a real-life military time e.g. 21:45

    Somebody bored enough to help me?
    And don't just slap a link in here on how to get or set world time. I know that.
    I need the formula to transfer the minecraft time to the realtime.
     
  2. To get the amount of hours, just divide the number of ticks this day by a 1000 (keep both as int, will handle the truncating for you). To get the amount of minutes, use a modulo of 1000 on the amount of ticks to get the ticks in this hour. Then just divide this amount by (1000/60=16.66) to get the minutes (again rounding down by keeping it ints.
     
    • Like Like x 1
Thread Status:
Not open for further replies.