You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Francisco Solis edited this page Jul 5, 2021
·
2 revisions
Setting Up the API
Make sure you added the repository and dependency to your maven project, then you can continue ;)
Creating the main class
To create a Spigot plugin with SuperCoreAPI you need to extend your main class to xyz.theprogramsrc.supercoreapi.spigot.SpigotPlugin, and then you must override the following methods: onPluginLoad, onPluginEnable, onPluginDisable.
Your main class should be like this one:
packagexyz.theprogramsrc.myplugin.spigot;
importxyz.theprogramsrc.supercoreapi.spigot.SpigotPlugin;
publicclassMySpigotPluginextendsSpigotPlugin{
@OverridepublicvoidonPluginLoad() {
// On plugin load stuff
}
@OverridepublicvoidonPluginEnable() {
// On plugin enable stuff
}
@OverridepublicvoidonPluginDisable() {
// On plugin disable stuff
}
}
You need to extend your main class to the SpigotPlugin class because the API needs to pre-load a lot of stuff like the translation manager, configuration files, etc.
Make sure to specify your main class in the plugin.yml so it can be loaded into the server.