Interface Task

All Superinterfaces:
AutoCloseable, Terminable

public interface Task extends Terminable
Represents a scheduled repeating task.
  • Method Details

    • getTimesRan

      int getTimesRan()
      Gets the number of times this task ran. The counter is only incremented at the end of execution.
      Returns:
      the number of times this task ran
    • stop

      boolean stop()
      Stops the task.
      Returns:
      true if the task wasn't already cancelled
    • getBukkitId

      int getBukkitId()
      Gets the Bukkit ID for this task.
      Returns:
      the bukkit id for this task
    • close

      default void close()
      Stops the task.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Terminable