Skip to content

Creating the Main Class

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:

package xyz.theprogramsrc.myplugin.spigot;

import xyz.theprogramsrc.supercoreapi.spigot.SpigotPlugin;

public class MySpigotPlugin extends SpigotPlugin{

    @Override
    public void onPluginLoad() {
        // On plugin load stuff
    }

    @Override
    public void onPluginEnable() {
        // On plugin enable stuff
    }

    @Override
    public void onPluginDisable() {
        // 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.

> Current Version

> Donate
PayPal
Patreon

Clone this wiki locally