> For the complete documentation index, see [llms.txt](https://glitchtechs.gitbook.io/galaxy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glitchtechs.gitbook.io/galaxy/starapi-spigot-paper/timers/delayed-timers.md).

# Delayed Timers

Delay a task from being ran

### Overview

The `DelayedTimer` class provides a utility for scheduling delayed tasks in Bukkit.

### Methods

#### `scheduleDelayedTask`

```java
public static BukkitTask scheduleDelayedTask(Plugin plugin, long delay, Runnable task)
```

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**

1. Call the `scheduleDelayedTask` method and pass the plugin instance, delay in ticks, and the task to be executed as parameters.

### Example

```java
Plugin plugin = // your plugin instance
long delay = 20; // 20 ticks (1 second)
Runnable task = () -> {
    // Your task logic here
};
BukkitTask scheduledTask = DelayedTimer.scheduleDelayedTask(plugin, delay, task);
```

In this example, we schedule a delayed task using the `scheduleDelayedTask` method. The task will run after a delay of 20 ticks (1 second).
