Comment on page
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
.To register the entrypoint, you do the same as you would with the
main
or client
entrypoint inside of fabric.mod.json
fabric.mod.json
{
"entrypoints": {
"controlify": [
"com.example.mymod.ControlifyEntrypoint"
]
}
}
Then simply create the class and implement the interface:
ControlifyEntrypoint.java
public class ControlifyEntrypoint implements ControlifyEntrypoint {
@Override
public void onControlifyPreInit(ControlifyApi controlify) {
// ...
}
@Override
public void onControllersDiscovered(ControlifyApi controlify) {
// ...
}
}
The
onControlifyPreInit
method is called once Controlify has initialised some systems but controllers have not yet been discovered and constructed. This is the ideal time to register things such as bindings, button guide, ingame guide, events etc in preparation for controller discovery.Currently, there are no APIs that require to be called from this method, however any custom code can be called from here now the initial controller discovery has completed.
Last modified 7mo ago