Package org.bukkit.event.entity
Class CreatureSpawnEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntitySpawnEvent
org.bukkit.event.entity.CreatureSpawnEvent
- All Implemented Interfaces:
Cancellable
public class CreatureSpawnEvent extends EntitySpawnEvent
Called when a creature is spawned into a world.
If a Creature Spawn event is cancelled, the creature will not spawn.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreatureSpawnEvent.SpawnReasonAn enum to specify the type of spawning -
Field Summary
-
Constructor Summary
Constructors Constructor Description CreatureSpawnEvent(Entity spawnee, CreatureType type, Location loc, CreatureSpawnEvent.SpawnReason reason)Deprecated.CreatureSpawnEvent(LivingEntity spawnee, CreatureSpawnEvent.SpawnReason spawnReason) -
Method Summary
Modifier and Type Method Description CreatureTypegetCreatureType()Deprecated.In favour ofEntityEvent.getEntityType().LivingEntitygetEntity()Returns the Entity involved in this eventCreatureSpawnEvent.SpawnReasongetSpawnReason()Gets the reason for why the creature is being spawned.Methods inherited from class org.bukkit.event.entity.EntitySpawnEvent
getHandlerList, getHandlers, getLocation, isCancelled, setCancelled
-
Constructor Details
-
CreatureSpawnEvent
-
CreatureSpawnEvent
@Deprecated public CreatureSpawnEvent(Entity spawnee, CreatureType type, Location loc, CreatureSpawnEvent.SpawnReason reason)Deprecated.
-
-
Method Details
-
getEntity
Description copied from class:EntityEventReturns the Entity involved in this event- Overrides:
getEntityin classEntityEvent- Returns:
- Entity who is involved in this event
-
getCreatureType
Deprecated.In favour ofEntityEvent.getEntityType().Gets the type of creature being spawned.- Returns:
- A CreatureType value detailing the type of creature being spawned
-
getSpawnReason
Gets the reason for why the creature is being spawned.- Returns:
- A SpawnReason value detailing the reason for the creature being spawned
-