Controlify Entrypoint
Learn how to hook into Controlify.
Controlify provides a Fabric entrypoint to hook into important lifecycle stages of Controlify. You do this just like ClientModInitializer.
Registering the entrypoint
- On Fabric, you register an entrypoint like any other, by adding an entry to your
fabric.mod.jsonfile under theentrypointssection. - On NeoForge (or Fabric), you register an entrypoint using a Java service provider interface (SPI) in your
META-INF/servicesdirectory.
json
{
"entrypoints": {
"controlify": [
"com.example.mymod.ControlifyEntrypoint"
]
}
}txt
com.example.mymod.MyControlifyEntrypointThen simply create the class and implement the interface:
java
public class ControlifyEntrypoint implements ControlifyEntrypoint {
@Override
public void onControlifyPreInit(PreInitContext ctx) {
// ...
}
@Override
public void onControlifyInit(InitContext ctx) {
}
@Override
public void onControllersDiscovered(ControlifyApi controlify) {
// ...
}
}Using the entrypoint
Use intellisense to see the methods available in each of the init contexts.
Such things include registering custom bindings, button guides, and more.