Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Terrocraft edited this page Apr 26, 2025 · 1 revision

CrayonSystem Wiki

Welcome to the CrayonSystem Wiki! CrayonSystem is a plugin that allows developers to add their own functionalities to the CrayonSMP server in the form of modules.

Creating a Module

Modules are the core of CrayonSystem. They allow the server to be extended with new functions in a modular way.

1. Implement the CrayonModule Interface

Every module must implement the CrayonModule interface. Create a new Java class that implements this interface:

package your.domain.yourmodule;

import net.crayonsmp.CrayonAPI; //
import net.crayonsmp.interfaces.CrayonModule; //
import org.bukkit.plugin.Plugin;
import de.bluecolored.bluemap.api.BlueMapAPI;

public class MyFirstModule implements CrayonModule { //

    @Override
    public String getName() { //
        // Specify the name of your module here
        return "MyFirstModule";
    }

    @Override
    public String getVersion() { //
        // Specify the version of your module here
        return "1.0.0";
    }

    // Optional method: Called when the module is loaded
    @Override
    public void onLoad(CrayonAPI api) { //
        api.getLogger().info(getName() + " is loading!"); //
    }

    // Called when the module is enabled
    @Override
    public <API extends Plugin & CrayonAPI> void onEnable(API plugin) { //
        plugin.getLogger().info(getName() + " has been enabled!"); //
        // Your logic goes here, e.g., register commands, register events, etc.
    }

    // Optional method: Called when the module is disabled
    @Override
    public void onDisable() { //
        System.out.println(getName() + " has been disabled!"); //
        // Perform cleanup tasks here
    }

    // Optional method: Specify the author of the module
    @Override
    public String getAuthor() { //
        return "Your Name";
    }

    // Optional method: Called when the BlueMap API is loaded
     @Override
     public void OnBlueMapEnabled(BlueMapAPI blueMapAPI){ //
         // Interact with BlueMap
     }
}

Clone this wiki locally