TimerAPI
A library for simplified timer handling in Minecraft mods. Provides an intuitive API for creating and managing time intervals with minimal effort.
Key Features
- Handling of start, end, and tick events
- Method chaining for convenient code writing
- Additional utility functions
- Asynchronous timer execution capability
Installation
Add the following lines to your build.gradle.kts file:
repositories {
maven("https://repo.chihuyu.love/snapshots/")
}
dependencies {
compileOnly("love.chihuyu:TimerAPI:1.4.1-SNAPSHOT")
}
Usage Example
// This timer lasts 180 * 20(1 second) = 3600 ticks (3 minutes)
val timer = TimerAPI.build("wait ramen", duration = 180, period = 20, delay = 0)
.start {
hotWater.drip()
}
.tick {
some()
}
.end {
ramen.eat()
}
timer.run()