Cancellablepublic class CreatureSpawnEvent extends EntityEvent implements Cancellable
If a Creature Spawn event is cancelled, the creature will not spawn.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
CreatureSpawnEvent.SpawnReason |
An enum to specify the type of spawning
|
Event.Resultentity| Constructor | Description |
|---|---|
CreatureSpawnEvent(LivingEntity spawnee,
CreatureSpawnEvent.SpawnReason spawnReason) |
| Modifier and Type | Method | Description |
|---|---|---|
LivingEntity |
getEntity() |
Returns the Entity involved in this event
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
Location |
getLocation() |
Gets the location at which the creature is spawning.
|
CreatureSpawnEvent.SpawnReason |
getSpawnReason() |
Gets the reason for why the creature is being spawned.
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel) |
Sets the cancellation state of this event.
|
getEntityTypegetEventName, isAsynchronouspublic CreatureSpawnEvent(LivingEntity spawnee, CreatureSpawnEvent.SpawnReason spawnReason)
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this eventpublic LivingEntity getEntity()
EntityEventgetEntity in class EntityEventpublic Location getLocation()
public CreatureSpawnEvent.SpawnReason getSpawnReason()
public HandlerList getHandlers()
getHandlers in class Eventpublic static HandlerList getHandlerList()