Interface Scheduler

All Known Implementing Classes:
BukkitScheduler, FoliaScheduler

public interface Scheduler
The scheduler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Scheduler
    The current Scheduler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancelAllTasks(org.bukkit.plugin.Plugin plugin)
    Cancel all tasks of the plugin
    default Task
    runEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, boolean async)
    Run a task related to an entity
    runEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, boolean async)
    Run a task related to an entity
    default Task
    runEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, long delay, boolean async)
    Run a delayed task related to an entity
    runEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, long delay, boolean async)
    Run a delayed task related to an entity
    default Task
    runEntityTaskLaterWithFinalizer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable finalizer, long delay, boolean async)
    Run a delayed task related to an entity with a finalizer.
    default Task
    runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, long delay, long period, boolean async)
    Run a task repeatedly related to an entity
    default Task
    runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, long delay, long period, boolean async)
    Run a task repeatedly related to an entity
    default Task
    runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, BooleanSupplier runnable, long delay, long period, boolean async)
    Run a task repeatedly related to an entity
    runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, BooleanSupplier runnable, Runnable retired, long delay, long period, boolean async)
    Run a task repeatedly related to an entity
    default Task
    runEntityTaskWithFinalizer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable finalizer, boolean async)
    Run a task related to an entity with a finalizer.
    runTask(org.bukkit.plugin.Plugin plugin, Runnable runnable, boolean async)
    Run a task
    runTaskLater(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, boolean async)
    Run a delayed task
    default Task
    runTaskTimer(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, long period, boolean async)
    Run a task repeatedly
    runTaskTimer(org.bukkit.plugin.Plugin plugin, BooleanSupplier runnable, long delay, long period, boolean async)
    Run a task repeatedly
  • Field Details

  • Method Details

    • cancelAllTasks

      void cancelAllTasks(org.bukkit.plugin.Plugin plugin)
      Cancel all tasks of the plugin
      Parameters:
      plugin - the plugin
    • runTask

      Task runTask(org.bukkit.plugin.Plugin plugin, Runnable runnable, boolean async)
      Run a task
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task
      async - whether the task is async
      Returns:
      the task
    • runTaskLater

      Task runTaskLater(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, boolean async)
      Run a delayed task
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task
      delay - the delay in ticks before the task is run
      async - whether the task is async
      Returns:
      the task
    • runTaskTimer

      Task runTaskTimer(org.bukkit.plugin.Plugin plugin, BooleanSupplier runnable, long delay, long period, boolean async)
      Run a task repeatedly
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task. Return true to continue, false to stop.
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runTaskTimer

      default Task runTaskTimer(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, long period, boolean async)
      Run a task repeatedly
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runEntityTask

      Task runEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, boolean async)
      Run a task related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      retired - the task when the entity is retired (e.g. removed, invalid)
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskLater

      Task runEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, long delay, boolean async)
      Run a delayed task related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      retired - the task when the entity is retired (e.g. removed, invalid)
      delay - the delay in ticks before the task is run
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskTimer

      Task runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, BooleanSupplier runnable, Runnable retired, long delay, long period, boolean async)
      Run a task repeatedly related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task. Return true to continue, false to stop.
      retired - the task when the entity is retired (e.g. removed, invalid)
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskTimer

      default Task runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, long delay, long period, boolean async)
      Run a task repeatedly related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      retired - the task when the entity is retired (e.g. removed, invalid)
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runEntityTask

      default Task runEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, boolean async)
      Run a task related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskLater

      default Task runEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, long delay, boolean async)
      Run a delayed task related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskTimer

      default Task runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, BooleanSupplier runnable, long delay, long period, boolean async)
      Run a task repeatedly related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task. Return true to continue, false to stop.
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskTimer

      default Task runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, long delay, long period, boolean async)
      Run a task repeatedly related to an entity
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskWithFinalizer

      default Task runEntityTaskWithFinalizer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable finalizer, boolean async)
      Run a task related to an entity with a finalizer. The finalizer will be run both after the task is run and when the entity is retired.
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      finalizer - the finalizer
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskLaterWithFinalizer

      default Task runEntityTaskLaterWithFinalizer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable finalizer, long delay, boolean async)
      Run a delayed task related to an entity with a finalizer. The finalizer will be run both after the task is run and when the entity is retired.
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      finalizer - the finalizer
      delay - the delay in ticks before the task is run
      async - whether the task is async
      Returns:
      the task