Making a loop that last for a long amount of time

Discussion in 'Spigot Plugin Development' started by Griffdragon, Jul 19, 2018.

  1. So im trying to make a sort of war plugin, that when to races go to war (ie. dragons vs elves). They have like 10 hours to duke it out. I know how to do this with a bukkit runnable, but my instinct tells me that will either cause lag or is not the best way to do it. How should this be done?
     
  2. Why should it cause lag? Is just a runnable that is run after X time. The only thing that could problematic would be if you have LOAD and LOAD of this instances that are kept for that long but doesn't seem the case.
     
  3. Well, my question is how is the event starting? Is it through a command? An event?
     
  4. It would be starting through a command, but if the server restarts in the middle of a runnable that would cancel it yes?
     
  5. Yes, it will. You need to save it through some persistent way, in a database or a file.