Hey guys, I would like to introduce you to my timer's utility library. This library allows you to create timers that can run specific code when it starts & ends, and you can also set timers to run at certain intervals.
The library works with both player timers (such as combat tag, immunity) and global timers (such as grace periods, etc). In fact, the library allows you to use any object you wish, to make completely custom timers, like faction timers, event timers and much more.
Here's an example usage to create a simple player-bound timer:
Here's an example usage to create a player-bound immunity timer:
Using the built-in timer lookup system, we can easily check whether the user has a timer already, or not. If they have a timer, we cancel the event. If they don't have the timer, we create the timer from the first example usage.
Sweet, huh?
How to add to your plugin
Maven
Add this to your pom.xml
Java:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Java:
<dependency>
<groupId>com.github.hostadam</groupId>
<artifactId>timers</artifactId>
<version>1.4</version>
</dependency>
Gradle
Java:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Java:
dependencies {
implementation 'com.github.hostadam:timers:1.4'
}
That's it! If you like this library, I wouldn't mind a star on GitHub.
Check out my Fiverr for custom orders here.
- Type
- Offering
- Exclusivity
-
- Non-exclusive
- Server software
-
- Bukkit
- Spigot
- Paper
- Supported versions
-
- 1.20
