# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ae.advancedplugins.net/for-developers/plugin-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
