Package-level declarations

Types

Link copied to clipboard
class BukkitDispatcher(val plugin: Plugin) : CoroutineDispatcher

A CoroutineDispatcher that dispatches blocks to the Bukkit scheduler.

Link copied to clipboard
class BukkitTaskHandle(plugin: Plugin, task: BukkitTask) : TaskHandle

A TaskHandle implementation for Bukkit tasks.

Link copied to clipboard
fun interface Condition

Represents a condition that can be evaluated to determine if a task should run.

Link copied to clipboard
class ConditionalRepeating(scheduler: Scheduler, delay: Ticks = ZERO, period: Ticks = ZERO) : Runner

A Runner that executes a task repeatedly as long as a condition is met.

Link copied to clipboard
class CoroutineTaskHandle(plugin: Plugin, job: Job) : TaskHandle

A TaskHandle implementation for Coroutine jobs.

Link copied to clipboard
class PlayerOnline(player: Player) : Condition

A condition that is met if the player is online.

Link copied to clipboard

Registry for managing Scheduler instances per Plugin.

Link copied to clipboard
class RunLimit(max: Int) : Condition

A condition that is met until the number of executions reaches max.

Link copied to clipboard
interface Runner

Interface for executing tasks.

Link copied to clipboard
class Scheduler(plugin: Plugin)

Wrapper for the Bukkit scheduler.

Link copied to clipboard
class TaskBuilder(plugin: Plugin)

DSL for building and scheduling tasks.

Link copied to clipboard
interface TaskHandle

Represents a handle to a scheduled task.

Link copied to clipboard
class TaskManager(plugin: Plugin)

Manages scheduled tasks and their lifecycle.

Link copied to clipboard
class ThenScope(plugin: Plugin, delay: Ticks) : Runner

Scope for chaining tasks that should execute sequentially with a delay.

Link copied to clipboard
value class Ticks(val value: Long)

Represents a duration in Minecraft ticks.

Link copied to clipboard
class TimeLimit(duration: Ticks) : Condition

A condition that is met until the specified duration has passed.

Properties

Link copied to clipboard

A condition that is always met.

Link copied to clipboard

Converts this Int minutes to Ticks.

Link copied to clipboard

A condition that is never met.

Link copied to clipboard
val Plugin.scheduler: Scheduler

The Scheduler instance for this plugin.

Link copied to clipboard

Converts this Int seconds to Ticks.

Link copied to clipboard

Creates a new TaskBuilder for this plugin.

Link copied to clipboard

The TaskManager instance for this plugin.

Link copied to clipboard

Converts this Int to Ticks.

Converts this Long to Ticks.

Link copied to clipboard
val ZERO: Ticks

Functions

Link copied to clipboard
fun Plugin.removeScheduler(): Unit?

Removes the scheduler for this plugin and cancels all associated tasks.

Link copied to clipboard
fun Player.taskAfter(plugin: Plugin, delay: Ticks, task: () -> Unit): TaskHandle

Schedules a task to run after the specified delay and tracks it for this Player.

Link copied to clipboard
fun World.taskLaunch(plugin: Plugin, block: suspend CoroutineScope.() -> Unit): TaskHandle

Launches a coroutine on the Bukkit main thread and tracks it for this World.

fun Player.taskLaunch(plugin: Plugin, block: suspend CoroutineScope.() -> Unit): TaskHandle

Launches a coroutine on the Bukkit main thread and tracks it for this Player.

Link copied to clipboard
fun World.taskTimer(plugin: Plugin, delay: Ticks, period: Ticks, task: () -> Unit): TaskHandle

Schedules a repeated task with the specified delay and period and tracks it for this World.

Link copied to clipboard
infix fun TaskHandle.then(delay: Ticks): ThenScope

Chains a task to be executed after the current task with the specified delay.