Interface Scheduler
- All Known Implementing Classes:
BukkitScheduler,FoliaScheduler
public interface Scheduler
The scheduler
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelAllTasks(org.bukkit.plugin.Plugin plugin) Cancel all tasks of the plugindefault TaskrunEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, boolean async) Run a task related to an entityrunEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, boolean async) Run a task related to an entitydefault TaskrunEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, long delay, boolean async) Run a delayed task related to an entityrunEntityTaskLater(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 entitydefault TaskrunEntityTaskLaterWithFinalizer(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 TaskrunEntityTaskTimer(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 entitydefault TaskrunEntityTaskTimer(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 entitydefault TaskrunEntityTaskTimer(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 entityrunEntityTaskTimer(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 entitydefault TaskrunEntityTaskWithFinalizer(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.Run a taskrunTaskLater(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, boolean async) Run a delayed taskdefault TaskrunTaskTimer(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, long period, boolean async) Run a task repeatedlyrunTaskTimer(org.bukkit.plugin.Plugin plugin, BooleanSupplier runnable, long delay, long period, boolean async) Run a task repeatedly
-
Field Details
-
CURRENT
-
-
Method Details
-
cancelAllTasks
void cancelAllTasks(org.bukkit.plugin.Plugin plugin) Cancel all tasks of the plugin- Parameters:
plugin- the plugin
-
runTask
Run a task- Parameters:
plugin- the plugin that owns the taskrunnable- the taskasync- whether the task is async- Returns:
- the task
-
runTaskLater
Run a delayed task- Parameters:
plugin- the plugin that owns the taskrunnable- the taskdelay- the delay in ticks before the task is runasync- 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 taskrunnable- the task. Return true to continue, false to stop.delay- the delay in ticks before the task is runperiod- the period in ticks between each runasync- 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 taskrunnable- the taskdelay- the delay in ticks before the task is runperiod- the period in ticks between each runasync- 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 taskentity- the entity that the task is related torunnable- the taskretired- 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 taskentity- the entity that the task is related torunnable- the taskretired- the task when the entity is retired (e.g. removed, invalid)delay- the delay in ticks before the task is runasync- 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 taskentity- the entity that the task is related torunnable- 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 runperiod- the period in ticks between each runasync- 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 taskentity- the entity that the task is related torunnable- the taskretired- the task when the entity is retired (e.g. removed, invalid)delay- the delay in ticks before the task is runperiod- the period in ticks between each runasync- 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 taskentity- the entity that the task is related torunnable- the taskasync- 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 taskentity- the entity that the task is related torunnable- the taskasync- 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 taskentity- the entity that the task is related torunnable- the task. Return true to continue, false to stop.delay- the delay in ticks before the task is runperiod- the period in ticks between each runasync- 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 taskentity- the entity that the task is related torunnable- the taskasync- 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 taskentity- the entity that the task is related torunnable- the taskfinalizer- the finalizerasync- 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 taskentity- the entity that the task is related torunnable- the taskfinalizer- the finalizerdelay- the delay in ticks before the task is runasync- whether the task is async- Returns:
- the task
-