Download TimerAPI — Minecraft Mods — MetaMods

TimerAPI

Active

Downloads

6

Last update

2 years ago

Versions

1.8 — 1.21
Server
Libraries
Mini-games
Utils

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()
Project members
hirosuke

hirosuke

Developer

Created: 21 Mar 2023

ID: 15714