HomeJavaModsSeptyrTimer
Introduction
SeptyrTimer is an easy-to-use API for timers, countdowns, cooldowns, etc. Its primary purpose is to avoid the chance of creating too many BukkitRunnables, which can eat up RAM. Additionally, the system technically isn't run on Minecraft ticks. Instead, it uses the precise time from the system. This means that your timers are 100% more reliable. Minecraft ticks are approximately 1/20 of a second. However, it's not perfect, and isn't reliable when working with timings longer than a minute.

How to Use
To create a timer, there are 2 options. You can create a timer using seconds, or ticks. If you do not provide a second argument after the tag, the Timer will default to running every tick.
Code (Text):
// Create new Timer that will run every game tick
Timer timer_1 = new Timer("tickcounter");

// Create new Timer that will run every 60 seconds
Timer timer_2 = new Timer("server message", 60d);

// Create new Timer that will run every 30 ticks
Timer timer_3 = new Timer("cooldown", (short) 30);
This API introduces two events: TimerEvent and TickEvent. TimerEvent will run when any existing Timer object finishes. TickEvent will run every tick, which is easier to use than creating multiple BukkitRunnables.

Code (Text):
String searchTag = "cooldown";

for (Timer t : SeptyrTimer.timers) {
    if (t.tag == searchTag) {
        // Retrieves each Timer with tag of "cooldown"
    }
}
The above code is an example of how to search for all running Timers with a specific tag. Timers can share tags for this purpose. This makes it easy to, say, cancel multiple Timers for the same function.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

SeptyrTimer is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11. Downloaded 150 times (via Spigot). Download it and open it directly in the game.

Explore more