> For the complete documentation index, see [llms.txt](https://ae.advancedplugins.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ae.advancedplugins.net/for-developers/plugin-api.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
