DenizenMC

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

MyPlugin.java
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.

EventFired when
SpawnerPlaceEventA spawner is placed
SpawnerBreakEventA spawner is broken. Also tells you whether an item will drop
SpawnerStackEventA spawner's stack size is about to change
SpawnerLootGenerateEventA cycle is about to add its drops and experience
SpawnerSellEventA 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.

Did this page help?

Last updated on