-
Notifications
You must be signed in to change notification settings - Fork 17
API Documentation Plugins
Exopandora edited this page Jun 1, 2024
·
1 revision
Plugins provide a way to extend the existing functionality of Shoulder Surfing. The following section describes how to create and successfully register a plugin.
Create a class that implements IShoulderSurfingPlugin
public class ExamplePlugin implements IShoulderSurfingPlugin {
@Override
public void register(IShoulderSurfingRegistrar registrar) {
// register your callbacks here
}
}
Create a file called shouldersurfing_plugin.json
in the root folder of your mod (src/main/resources
) to register your plugin.
The JSON must contain a single field called "entrypoint", which points to the class that should be loaded as a plugin.
{
"entrypoint": "com.example.ExamplePlugin"
}
Simply annotate your plugin class with @ShoulderSurfingPlugin
@ShoulderSurfingPlugin
public class ExamplePlugin implements IShoulderSurfingPlugin {
@Override
public void register(IShoulderSurfingRegistrar registrar) {
// register your callbacks here
}
}