Something that runs every 5 minutes

Discussion in 'Spigot Plugin Development' started by DuYan, May 27, 2015.

Thread Status:
Not open for further replies.
  1. Is there a way to make something run every 5 minutes?
     
    • Agree Agree x 1
    • Useful Useful x 1
  2. meh could also go the Bukkit way
    Code (Text):

    new BukkitRunnable() {
      public void run() {
        // do stuff
      }
    }.runTaskTimer(plugin, 0L, 6000L);
     
     
    • Useful Useful x 2
    • Like Like x 1
  3. Had he wanted to use Skript, OP wouldn't have posted this in Spigot Plugin Development.
     
    • Agree Agree x 2
    • Useful Useful x 1
  4. You're funny
     
    • Useful Useful x 1
  5. Use a scheduler.
    Code (Text):
    Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
    public void run() {
    //do here what you need to do.
    }
    }, 0L, 20L * 300); //first is delay time, second is repeating time so 5 min.
    EDIT: Posted this from my mobile. Make code your own.
     
    • Useful Useful x 1
  6. oshit, I didn't even see the category...

    I'll just be packing my things...

    *walks out*
     
    • Funny Funny x 1
    • Useful Useful x 1
Thread Status:
Not open for further replies.