public class CreatureSpawnEvent extends EntityEvent implements Cancellable
If a Creature Spawn event is cancelled, the creature will not spawn.
Modifier and Type | Class and Description |
---|---|
static class |
CreatureSpawnEvent.SpawnReason
An enum to specify the type of spawning
|
Event.Result
entity
Constructor and Description |
---|
CreatureSpawnEvent(Entity spawnee,
CreatureType type,
Location loc,
CreatureSpawnEvent.SpawnReason reason)
Deprecated.
|
CreatureSpawnEvent(LivingEntity spawnee,
CreatureSpawnEvent.SpawnReason spawnReason) |
Modifier and Type | Method and Description |
---|---|
CreatureType |
getCreatureType()
Deprecated.
In favour of
EntityEvent.getEntityType() . |
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.
|
getEntityType
getEventName, isAsynchronous
public CreatureSpawnEvent(LivingEntity spawnee, CreatureSpawnEvent.SpawnReason spawnReason)
@Deprecated public CreatureSpawnEvent(Entity spawnee, CreatureType type, Location loc, CreatureSpawnEvent.SpawnReason reason)
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this eventpublic LivingEntity getEntity()
EntityEvent
getEntity
in class EntityEvent
public Location getLocation()
@Deprecated public CreatureType getCreatureType()
EntityEvent.getEntityType()
.public CreatureSpawnEvent.SpawnReason getSpawnReason()
public HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
Copyright © 2014. All rights reserved.