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.
{"entrypoints": {"controlify": ["com.example.mymod.ControlifyEntrypoint"]}}
Then simply create the class and implement the interface:
public class ControlifyEntrypoint implements ControlifyEntrypoint {@Overridepublic void onControlifyPreInit(PreInitContext ctx) {// ...}@Overridepublic void onControlifyInit(InitContext ctx) {}@Overridepublic 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.