TaskBuilder

class TaskBuilder(plugin: Plugin)

DSL for building and scheduling tasks.

This class provides methods to define the execution timing and environment (synchronous/asynchronous) of a task.

Parameters

plugin

the Plugin instance to schedule tasks under

Constructors

Link copied to clipboard
constructor(plugin: Plugin)

Types

Link copied to clipboard
inner class DelayedTask(delay: Ticks) : Runner

Represents a task that is set to run after a certain delay.

Link copied to clipboard
inner class RepeatingTask(delay: Ticks, period: Ticks) : Runner

Represents a task that is set to run repeatedly.

Functions

Link copied to clipboard

Schedules a task to run after the specified delay.

Link copied to clipboard
infix fun async(task: () -> Unit): TaskHandle

Runs the task asynchronously.

Link copied to clipboard
infix fun launch(block: suspend CoroutineScope.() -> Unit): TaskHandle

Launches a coroutine on the Bukkit main thread.

Link copied to clipboard
infix fun launchAsync(block: suspend CoroutineScope.() -> Unit): TaskHandle

Launches a coroutine asynchronously.

Link copied to clipboard
infix fun now(task: () -> Unit): TaskHandle

Runs the task on the next tick (synchronously on the main thread).