promotional bannermobile promotional banner
premium banner
Library for creating unregisterable client and server tick events with dynamic lifecycles and delays

Description

ScheduledTickDispatcherLib

ScheduledTickDispatcherLib is a lightweight library mod built on top of the Fabric API, providing a clean, secure, and memory-safe way to schedule ticking tasks in Minecraft.

Designed for mod developers, it allows you to register both immediate and delayed tasks that automatically unregister themselves upon completion (or allow you to unregister them manually) — eliminating memory leaks and ensuring optimal performance.

Features

  • Tick Phases – Hook into precise lifecycle events (e.g. START_SERVER_TICK, END_CLIENT_WORLD_TICK) for exact control.
  • Delayed Tasks – Schedule delayed executions that begin after a custom tick offset.
  • Task Chaining – Utilities for chaining tasks together for serialized execution.
  • Self-Cleanup – Tasks automatically remove themselves after completion to prevent memory bloat.
  • Security Limits – Built-in caps on task registration per phase as well as limits to task duration and delays to avoid abuse and performance issues.

Installation

Add the library as a dependency via Maven:

repositories {
    maven {
        url "https://cursemaven.com"
    }
}

dependencies {
//Change latest_version to version of the file you're downloading.
//Current latest is 6397403.
    modImplementation "curse.maven:scheduledtickdispatcherlib-1236960:latest_version"
}

Then, refresh your project dependencies and you're good to go!

Usage

ScheduledTickDispatcher contains rich javadoc all over the place, documenting every class and method, as well as an example mod in the repository. For more in-depth explanation to cover most use cases, please view the Wiki.

Built-in Security

To ensure stability and prevent abuse:

  • A hard cap of 30 tasks per phase is enforced.
  • Internal logging tracks misuse and provides context for debugging.
  • Tasks unregister automatically when complete.