Custom Addons

Custom Addons are extensions that allow users to extend, modify, or enhance the functionality of our plugin. Think of them as building blocks that enable you to tailor the behavior of the plugin, making it uniquely yours.

Get Started!

Addon.yml File:

  • To begin customizing your plugin experience, ensure you have an "addon.yml" file in the resources of your Java project.

  • Open the "addon.yml" file and configure it according to your addon's specifications.

name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0
description: Small Description (Optional)
website: Website (Optional)

The "addon.yml" file serves as the configuration hub for your Custom Addon, providing essential metadata such as the addon's name, main class path, author details, version, and optional description and website information.

Main Class:

  • Ensure that the specified main class in the "addon.yml" file corresponds to the path of your addon class within your project.

package your.path;

import java.io.IOException;
import com.phoenixplugins.common.addons.Addon;

public class AddonExample extends Addon {

	public AddonExample () {
		// Custom Code if needed
	}

	@Override
	public void onLoad() {
		// Custom Code if needed
	}

	@Override
	public void onEnable() {
		try {
			// Custom Code if needed
		} catch (final Exception e) {
			e.printStackTrace();
			getAddonsManager().disableAddon(this);
		}
	}

	@Override
	public void onDisable() {
		// Custom Code if needed
	}

	@Override
	public String getRequiredPluginVersion() {
		return "2.1.4"; // Define the main required version 
	}

}

Compile your Addon:

  • Compile your Custom Addon following your Java project's build instructions.

Install your Addon:

  • Move the compiled JAR file to the "addons" folder within the "PhoenixCrates" directory in your server plugins.

  • Restart the server to apply changes and activate your Custom Addon.

Last updated