🕙Active Timers

Check if a timer is active

Overview

The ActiveTimers class provides a utility for managing active Bukkit tasks in a plugin.

Fields

activeTasks

static final Map<BukkitTask, Plugin> activeTasks

A map that stores active Bukkit tasks along with their associated plugins.

Methods

isTaskActive

public static boolean isTaskActive(BukkitTask task)

Checks if a Bukkit task is currently active.

Parameters

  • task: The BukkitTask to check.

Returns

  • boolean: true if the task is active, false otherwise.

Usage

  1. Use the isTaskActive method to check if a Bukkit task is currently active.

Example

BukkitTask task = // your BukkitTask instance
boolean isActive = ActiveTimers.isTaskActive(task);
if (isActive) {
    // Task is active
} else {
    // Task is not active
}

In this example, we check if a Bukkit task is currently active using the isTaskActive method.

Last updated