+ auto_restarter_world: type: world debug: false events: on system time 03:00: - run auto_restarter_task on player logs in server_flagged:restart_happening: - determine "KICKED:Server is restarting momentarily, please wait." auto_restarter_task: type: task debug: false script: - wait 1m - - define marks + - define marks - foreach <[marks]> as:mark: - if : - foreach stop - - define display_in "<[mark].formatted.replace[s].with[ seconds].replace[m].with[ minutes].replace[1 minutes].with[1 minute]>" + - announce "<&c>Server will automatically restart in <[mark].formatted_words>." - - announce "<&c>Server will automatically restart in <[display_in]>." - if <[mark].in_seconds> <= 60: - - title "subtitle:<&c>Restart in <[display_in]>." fade_out:10s targets: + - title "subtitle:<&c>Restart in <[mark].formatted_words>." fade_out:10s targets: - flag server restart_happening duration:<[mark].add[10s]> - - wait <[mark].sub[<[marks].get[<[loop_index].add[1]>]||0s>]||5s> + - wait <[mark].sub[<[marks].get[<[loop_index].add[1]>]||0s>]> - flag server restart_happening duration:5s - announce "<&c>Server RESTARTING NOW!" - kick "reason:Restarting! Please wait a minute before rejoining." - wait 1s - adjust server restart +