The source code for TickRate
From TickRate v0.3.0 onwards, an API is exposed to allow other mods to programmatically use the /tick command. The API consists of 2 parts:
TickRateAPI- Basically the/tickcommand in API form. Obtain the API instance viaTickRateAPI.getInstance().TickRateEvents- Events that fire when a server/entity/chunk's tick rate/status is modified. Registering event handlers is identical to Fabric's events.
To use the API in your mod, first add the Modrinth Maven repository. Then, add the dependency in this format:
dependencies {
// e.g. modImplementation "maven.modrinth:tick:0.3.0-1.21.4"
modImplementation "maven.modrinth:tick:${mod_version}-${mc_version}"
}The API's documentation is provided by the sources/javadoc JAR hosted on the same repository. Make sure to downlaod them via your IDE.
However, due to a potential issue with Modrinth Maven, you may need to download these JARs manually.
These datapacks require the TickRate mod to function.
This is being released here because I can't be bothered to create another Modrinth project just for this :P