-
Notifications
You must be signed in to change notification settings - Fork 0
3. Create your main class
RedsTom edited this page May 15, 2021
·
1 revision
To load a plugin, your jar file must contain a class annotated with the @BotPlugin
annotation.
@BotPlugin(
id = "MyAddonId",
name = "My Addon",
author = "Me"
)
public class Main {
}
But this is not enough. The main class must have two methods :
load()
: Called when the plugin is loaded, when the server starts.
and
unload()
: Called when the plugin is unloaded, when the server stops. |
Your main class will finally look like this :
@BotPlugin(
id = "MyAddonId",
name = "My Addon",
author = "Me"
)
public class Main {
public void load() {
System.out.println("My Addon loaded !");
}
public void unload() {
System.out.println("My Addon unloaded !");
}
}
BotServer is under the MIT license and its author is RedsTom.