Interface ZScheduler


public interface ZScheduler

The ZScheduler interface provides methods for managing tasks and working with Folia.

  • Field Details

    • TIMER

      static final Timer TIMER
      The default timer used for scheduling tasks.
  • Method Details

    • runTask

      ZScheduler runTask(@Nullable org.bukkit.Location location, Runnable task)
      Runs the task.
      Parameters:
      location - Required for Folia, in Bukkit can be null.
      task - The task to run.
      Returns:
      The created ZScheduler.
    • runTaskAsynchronously

      ZScheduler runTaskAsynchronously(Runnable task)
      Runs the task asynchronously.
      Parameters:
      task - The task to run.
      Returns:
      The created ZScheduler.
    • runTaskLater

      ZScheduler runTaskLater(@Nullable org.bukkit.Location location, long delay, Runnable task)
      Runs the task after a specified number of ticks.
      Parameters:
      location - Required for Folia, in Bukkit can be null.
      task - The task to run.
      delay - The number of ticks to wait.
      Returns:
      The created ZScheduler.
    • runTaskLaterAsynchronously

      ZScheduler runTaskLaterAsynchronously(long delay, Runnable task)
      Runs the task asynchronously after a specified number of ticks.
      Parameters:
      task - The task to run.
      delay - The number of ticks to wait.
      Returns:
      The created ZScheduler.
    • runTaskTimer

      ZScheduler runTaskTimer(@Nullable org.bukkit.Location location, long delay, long period, Runnable task)
      Runs the task repeatedly on a timer.
      Parameters:
      location - Required for Folia, in Bukkit can be null.
      task - The task to run.
      delay - The delay before the task is first run (in ticks).
      period - The ticks elapsed before the task is run again.
      Returns:
      The created ZScheduler.
    • runTaskTimerAsynchronously

      ZScheduler runTaskTimerAsynchronously(long delay, long period, Runnable task)
      Runs the task repeatedly on a timer asynchronously.
      Parameters:
      task - The task to run.
      delay - The delay before the task is first run (in ticks).
      period - The ticks elapsed before the task is run again.
      Returns:
      The created ZScheduler.
    • cancel

      void cancel()
      Cancels the task.