Solved Cancel BukkitRunnable from another method.

Discussion in 'Plugin Development' started by ItsComits, Oct 28, 2017.

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

    ItsComits

    Hello, I have a bukkit runnable and I want to be able to cancel the bukkit runnable from another method. I do know that there is a cancel(). But the if statement only gets checked every 20 seconds. I want to be able to cancel the runnable immediately. Do I need to save any ids for the runnable so that I can get access to the runnable?
     
  2. Offline

    Zombie_Striker

    @ItsComits
    You can cancel the task as fast as you can call it. Store the instance of the the BukkitTask somewhere, and call cancel()
    when you want to cancel it.
     
  3. Offline

    ItsComits

    @Zombie_Striker As always thanks for your help. I'm glad I moved from Bukkit.getScheduler :D
     
Thread Status:
Not open for further replies.

Share This Page