events on time tick (Dusk, Dawn, Night, Day)

Discussion in 'Plugin Development' started by Drofzz, Jun 9, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Drofzz

    is there a way to trigger an event on a specific server timer?

    for example every servertime at Dusk or Dawn?
     
  2. use schadular or something to check for time chacnes
     
  3. Offline

    Drofzz

    i trought about that, but wouldnt that mean i need to make a repeatable schadular, that checks the time, each tick?
     
  4. you can make it check every 6000 ticks, what is around the 5 min, and start it at the first dawn
     
  5. Offline

    Drofzz

    i must be very naive to not had thord of that.. and then i could add the current server time as the delay, before it starts right?

    Code:
    startdelay = getServer().getWorld(configDefaultWorld).getTime() - serverfullcycletime
     
    getServer().getScheduler().scheduleAsyncRepeatingTask(this,  new TimeManagerListener(this), startdelay, 6000);
     
  6. yes, thats they way I mean
     
    Drofzz likes this.
  7. Offline

    Drofzz

    thanks, and thanks for the quick answer :)
     
  8. using the alert system is an great way to see if you have replys in 1 or another thread
     
Thread Status:
Not open for further replies.

Share This Page