Delayed Timers
Delay a task from being ran
Overview
The DelayedTimer
class provides a utility for scheduling delayed tasks in Bukkit.
Methods
scheduleDelayedTask
scheduleDelayedTask
Schedules a delayed task to run after a specified delay.
Parameters
plugin
: The plugin instance that is scheduling the task.delay
: The delay in server ticks before the task should be executed.task
: The task to be executed after the delay.
Returns
Returns the BukkitTask representing the scheduled task.
Usage
Call the
scheduleDelayedTask
method and pass the plugin instance, delay in ticks, and the task to be executed as parameters.
Example
In this example, we schedule a delayed task using the scheduleDelayedTask
method. The task will run after a delay of 20 ticks (1 second).
Last updated