Skip to content
goflishMC edited this page Jul 1, 2025 · 1 revision

🧩 Plugin API Overview

FabledEnchants exposes a simple API to allow developers to register their own custom enchantments via Java code. This API is ideal for plugin developers who want to bundle unique enchantments with their own addons.


🧱 Requirements

Before using the API, your plugin must:

  • Depend on FabledEnchants
  • Have plugin.yml properly configured with the dependency
depend: [FabledEnchants]

🔧 Base Class: CustomEnchantment

To create your own enchantment, extend the CustomEnchantment class provided by FabledEnchants.

public class MyEnchant extends CustomEnchantment {
    public MyEnchant() {
        super("MyEnchant", "Description of what it does");
    }
}

You can then override behavior methods like applyOnHit(...), applyEquip(...), etc.

👉 See Creating JAVA/API Enchants for full setup instructions.


🧪 Registration

To make your enchantment functional, it must be registered using the plugin API:

EnchantmentAPI.registerCustomEnchantment(new MyEnchant());

You must run this inside your plugin's onEnable() method.


📦 API Location

  • Package: com.sucy.enchant
  • Class: EnchantmentAPI

This class is available at runtime when FabledEnchants is installed.


📘 Next Steps

➡️ See Registering Enchants from Addons to bundle your custom enchants into a standalone plugin.

Clone this wiki locally