Creating Your Plugin
The first step of adding this library to your project

The Plugin Class

The class that you want to represent your plugin needs to extend me.darrionat.pluginlib.Plugin.
1
package me.darrionat.fakeplugin.FakePlugin;
2
3
import me.darrionat.fakeplugin.ErrorManager();
4
5
import me.darrionat.pluginlib.ErrorHandler;
6
import me.darrionat.pluginlib.Plugin;
7
8
public class FakePlugin extends Plugin {
9
10
public void initPlugin() {
11
// Initializes your command
12
new FakeCommand(this);
13
}
14
15
public ErrorHandler getErrorHandler() {
16
return new ErrorManager();
17
}
18
19
@Override
20
public void onDisable() {
21
22
}
23
}
Copied!
Typically, when you extend JavaPlugin, you use onEnable() but the Plugin superclass does some things behind the scenes before it starts your plugin, so you need to use initPlugin() instead.
When your plugin is disabled, onDisable() will be run.

Error Handlers

Every plugin is required to have an ErrorHandler. More information about the ErrorHandler interface can be found here.
Last modified 9mo ago