Using runTaskTimer()...

Discussion in 'Plugin Development' started by civ77, Mar 27, 2014.

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

    civ77

    Just a simple question: I am starting a task in a listener class which is outside of my main JavaPlugin class. I am doing this in the form: new Task (a, b).runTaskTimer(x, 20, 20);
    The problem is I can't remember what to put for the "x"... (it's after 2AM) any help would be appreciated.
     
  2. Offline

    mickedplay

    10:26 AM for me :p
    Do you Need this?
    Task = Main.getInstance().getServer().getScheduler.runTaskTimer(Main.getInstance(), new Runnable()
    {
    @Override
    public void run()
    {
    if(Task == 0)
    {
    task.cancel();
    }
    }
    }, 0L, 20L);
     
  3. Offline

    ZeusAllMighty11

    the x represents your main class which inherits JavaPlugin
     
Thread Status:
Not open for further replies.

Share This Page