Initializing
How to initialize your plugin with zAPI
Raw initialization
To initilize your plugin with zAPI you will need to call zAPI's init function:
package me.yleoft.example;
import me.yleoft.zAPI.zAPI;
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin {
public final String pluginName = getDescription().getName();
public final String coloredPluginName = this.pluginName; // Change to whatever you want
@Override
public void onEnable() {
zAPI.init(this, pluginName, coloredPluginName, null);
}
}
Initialization with NBTAPI
So if you want to access everything zAPI has to offer, you will need to use NBTAPI, and i highly recommend you to use it shaded in your plugin, just like zAPI.
After you got NBTAPI setup, change this line from Raw initialization:
zAPI.init(this, pluginName, coloredPluginName, null);
To this:
zAPI.init(this, pluginName, coloredPluginName, NBT.preloadApi());
Last updated
Was this helpful?