> 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/cancel-timers.md).

# Cancel Timers

Cancel a timer

### Overview

The `CancelTimer` class provides a utility for cancelling Bukkit tasks and removing them from the list of active tasks.

### Methods

#### `cancelTask`

```java
public static void cancelTask(BukkitTask task)
```

Cancels a Bukkit task and removes it from the list of active tasks.

**Parameters**

* `task`: The BukkitTask to cancel.

**Usage**

1. Call the `cancelTask` method and pass the Bukkit task you want to cancel as a parameter.

### Example

```java
BukkitTask task = // your BukkitTask instance
CancelTimer.cancelTask(task);
```

In this example, we cancel a Bukkit task using the `cancelTask` method.
