Question about adjusting time accurately

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Sep 25, 2017
18
0
1
53
I'm trying to create a skript that will fast forward time to the next new day. No console errors or reload errors. The code works as expected except for one small detail. The skript should adjust world time in 1 minute increments, but for some reason the actual world time always stops a few minutes after 6:00am. What am I doing wrong? For testing purposes I've also included my clock skript.

Skript Version (do not put latest): 2.5
Skript Author: Myself
Minecraft Version: 1.16.2
Full Code:
Code:
command /newday:
   trigger:
       set {ff} to "true"
       execute console command "/gamerule doDaylightCycle false"
       set {_time} to time in world
       message "Command start time is %{_time}%"
       while time in world is greater than 5:59am:
           add 1 minute to time in world
           wait 1 tick
       while time in world is less than 6:00am:
           add 1 minute to time in world
           wait 1 tick

every 1 minutes:
   if {ff} is "true":
       if time is 06:00am:
           execute console command "/gamerule doDaylightCycle true"
           broadcast "A New Day Is Here!"
           clear {ff}
           
command /ff:
   trigger:
       clear {ff}

Code:
command /clock:
    trigger:
        set {gametime} to time in world
        set {localtime::%player%} to placeholder "localtime_time_h:mm a" from player
        message "Local Time | %{localtime::%player%}%" to player
        if {gametime} is greater than 11:59:
            message "World Time | %{gametime}% PM" to player
            stop
        else if {gametime} is less than 12:00:
            message "World Time | %{gametime}% AM" to player
            stop


Errors on Reload: None



Console Errors: (if applicable) None


Other Useful Info: n/a

Addons using (including versions): n/a

Troubleshooting:

Have you tried searching the docs?
Have you tried searching the Forums?
What other methods have you tried to fix it?
Yes i have tried searching forums and docs.
 
Last edited:
Status
Not open for further replies.