Creating the addon
Once you have a basic Paper plugin set up, you can begin to make an Origins-Reborn addon.
First, you need to make your main class extend OriginsAddon
, rather than JavaPlugin
. This is so that your plugin is detected as an Origins-Reborn addon, rather than just being considered a normal plugin.
You will need to implement the getNamespace
method in your addon, where you have to return a String
representing your addon. Set this to any short string of text representing your plugin.
If you have an onEnable
method in your plugin's main class, you may notice that it is now showing an error.
This is because Origins-Reborn addons override the onEnable
method by default to perform tasks related to registering the plugin as an addon.
You can easily fix this by renaming your onEnable
method to onRegister
, which is called at the start of onEnable
in Origins-Reborn addons.
To add custom powers, you need to override the getRegisteredAbilities
method and return a list. This is where you'll return the custom powers your want to register.
This is what your main class should look like at this point:
In order to ensure your plugin is loaded after Origins-Reborn, add it to your plugin's dependencies. For a plugin.yml
, this is how to set a plugin as a dependancy:
Last updated
Was this helpful?