Darrionat Plugins
  • Welcome
  • Plugins
    • Bans+
      • Commands & Permissions
      • Configuration Files
      • GUIs
      • MySQL
      • Trivia
    • Command Cooldown
      • Commands & Permissions
      • Configuration Files
        • cooldowns.yml
        • config.yml
        • messages.yml
      • MySQL
      • Trivia
    • Custom Enchants+
      • API
      • Commands & Permissions
      • Configuration Files
        • config.yml
        • enchants.yml
        • lores.yml
        • messages.yml
      • Custom Blocks
      • Dependencies
      • Enchantments
      • GUIs
      • Scrolls
      • Wands
      • Trivia
    • PrisonPick
      • Autosell
      • Commands & Permissions
      • Configuration Files
        • autosell.yml
        • config.yml
        • enchants.yml
        • messages.yml
      • Dependencies
      • Enchantments
      • GUIs
      • Inventory Management
      • Placeholders
      • Saving Data
  • Libraries
    • PluginLib
      • Creating Your Plugin
      • Commands
      • Configs
      • ErrorHandler
      • Gui
  • Discord Bot
    • SpigotMC Bot
      • Commands
  • Links
    • Discord
    • GitHub
    • SpigotMC
  • Support Me
    • Patreon
Powered by GitBook
On this page
  • The Plugin Class
  • Error Handlers

Was this helpful?

  1. Libraries
  2. PluginLib

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.

package me.darrionat.fakeplugin.FakePlugin;

import me.darrionat.fakeplugin.ErrorManager();

import me.darrionat.pluginlib.ErrorHandler;
import me.darrionat.pluginlib.Plugin;

public class FakePlugin extends Plugin {

	public void initPlugin() {
	  // Initializes your command
		new FakeCommand(this);
	}

	public ErrorHandler getErrorHandler() {
		return new ErrorManager();
	}

	@Override
	public void onDisable() {
		
	}
}

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

PreviousPluginLibNextCommands

Last updated 4 years ago

Was this helpful?

Every plugin is required to have an ErrorHandler. More information about the ErrorHandler interface can be found .

here