# Plugin API

AEAPI class functions:&#x20;

![AEAPI](https://camo.githubusercontent.com/f01933d8a3682f5cfb4e65a7869860b9a7723b2e/68747470733a2f2f692e696d6775722e636f6d2f455863797949352e706e67)

### Apply custom enchants

Applying custom enchants is simple. Do remember, that the `AEAPI.applyEnchant` method also returns a modified ItemStack, which you will need to override with your current ItemStack object.

Example:

```java
ItemStack item = your item;
item = AEAPI.applyEnchant("enchantName", enchantLevel, item);
```

### Listen to events

We run normal Bukkit extended events. You can listen to those like you do with any other event. The package where events are is `net.advancedplugins.ae.impl.effects.api` and `net.advancedplugins.ae.api`

Don't use deprecated events! These might not be called at all at times!

<pre class="language-java"><code class="lang-java">@EventHandler
public void onEnchantActivate(EffectsActivateEvent e) {
<strong>    // Do as you wish or cancel the event
</strong>}
</code></pre>
