Hub.DenizenMC
EliteSpawner

Developer API

Reading spawners and reacting to spawner events from your own plugin.

EliteSpawner exposes an API for other plugins: look up, create and remove spawners, read their live state, and hook into five cancellable 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 before your plugin.

EliteSpawnerAPI

Look up, create and remove spawners by location.

SpawnerHandle

A spawner's live state: entity type, stack size, stored loot and experience. No internal types are exposed.

Events

All five events are cancellable.

EventFired when
SpawnerPlaceEventA spawner is placed
SpawnerBreakEventA spawner is broken. Also exposes whether an item will drop
SpawnerStackEventA spawner's stack size is about to change
SpawnerLootGenerateEventA generation cycle is about to apply its drops and experience
SpawnerSellEventA sale is about to go through

Mutable events

SpawnerLootGenerateEvent lets you change the drops and experience before they're stored, and SpawnerSellEvent lets you change the sale price.

The API may change before 1.0

EliteSpawner is in early development. Expect API changes between early versions and check the changelog when updating.

Last updated on

On this page