Developer API
Read spawners and react to spawner events from your own plugin.
Building something on top of EliteSpawner? The API lets your plugin find, create and remove spawners, read their live state, and listen to five events.
Getting the API
EliteSpawnerAPI api = EliteSpawnerProvider.get();
SpawnerHandle handle = api.getSpawner(location);Add EliteSpawner as a depend or softdepend in your plugin.yml so it loads first.
EliteSpawnerAPI
Look up, create and remove spawners by location.
SpawnerHandle
A spawner's live state: mob type, stack size, stored loot and experience.
Events
All five events can be cancelled.
| Event | Fired when |
|---|---|
SpawnerPlaceEvent | A spawner is placed |
SpawnerBreakEvent | A spawner is broken. Also tells you whether an item will drop |
SpawnerStackEvent | A spawner's stack size is about to change |
SpawnerLootGenerateEvent | A cycle is about to add its drops and experience |
SpawnerSellEvent | A sale is about to go through |
Change things on the way
SpawnerLootGenerateEvent lets you change the drops and experience before they're stored, and SpawnerSellEvent lets you change the price.
Subject to change
The API may change before 1.0. Check the changelog whenever you update.
Last updated on