> 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/edcosmetics/reference/api.md).

# Developer API

Add the jar as a `provided` dependency and `softdepend: [EdCosmetics]` in your plugin.yml. Everything runs on the main thread unless noted.

## Events

| Event                                                 | When                                                                                                          |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `es.edwardbelt.edcosmetics.api.SkinEffectChangeEvent` | a player's equipped SKIN cosmetic changed (also once after they join). `getPreset()` = the preset id, or null |
| `es.edwardbelt.edcosmetics.api.SkinRefreshEvent`      | a player's skin was just re-sent (their client dropped its own client-side entities)                          |

## One HUD at a time

`es.edwardbelt.edcosmetics.api.HudLock.busy(player)` is true while the wardrobe, the emote wheel or an emote is active for the player. If your plugin draws its own full-screen HUD, check it before opening yours, and set the metadata `HudLock.SHOP_META` on the player while yours is open so EdCosmetics doesn't open over it.

## Commands for other plugins

Crates, shops and battle passes don't need the API: run `cosmetics give <player> <category> <cosmetic>` from the console (works offline), `cosmetics take ...` to remove one, and read `%edcosmetics_<cat>_has_<cosmetic>%` to check ownership.
