> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/developer-api/enchants/custom-enchantments.md).

# Custom Enchantments

Example of custom enchantment:

```java
package your.package;

import com.edwardbelt.edprison.enchantments.manager.obj.Enchantment;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

public class EnchantExample extends Enchantment {

    public EnchantExample() {
        super(
                "my-enchant", // The enchant ID of enchantments.yml
                "BlockBreakEvent"  // The trigger event of the enchant
        );
    }

    /**
    *    The enchant function. You just need to put what the enchant will do.
    *    EdPrison will do the rest.
    **/
    @Override
    public void execute(Player player, Block block) {
        player.sendMessage("My custom enchant was triggered! " + getId());
    }
}

package your.package;

import location.EnchantExample;
public final class EdPrison extends JavaPlugin {

    @Override
    public void onEnable() {
        // Just create the instance on your onEnable() and it will 
        // automatically register.
        EnchantExample EnchantExample = new EnchantExample();
    }

}


```
