Package valorless.rarespawns.events
Class SpawnEvent
java.lang.Object
valorless.rarespawns.events.SpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener that intercepts natural creature spawns and, based on configured
spawn groups and chances, replaces the vanilla spawn with a custom "rare"
entity. Applies water/swimming filters, optional player distance capping,
per-player spawn limits, and world blacklists. Optionally moves the spawned
entity above ground, updates its data, caches it, and fires a RareSpawnEvent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Registers this listener with the Bukkit plugin manager.voidonCreatureSpawn(org.bukkit.event.entity.CreatureSpawnEvent event) Handles natural creature spawn events.
-
Constructor Details
-
SpawnEvent
public SpawnEvent()
-
-
Method Details
-
init
public static void init()Registers this listener with the Bukkit plugin manager. Should be invoked during plugin enable/startup. -
onCreatureSpawn
public void onCreatureSpawn(org.bukkit.event.entity.CreatureSpawnEvent event) Handles natural creature spawn events. If the event passes all configured checks and a spawn group chance succeeds, the original spawn is cancelled and a rare entity is spawned and initialized in its place.- Parameters:
event- the CreatureSpawnEvent fired by Bukkit
-