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
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 ClassesModifier and TypeClassDescriptionstatic enumAn enum to specify the type of spawningNested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionCreatureSpawnEvent(@NotNull LivingEntity spawnee, @NotNull CreatureSpawnEvent.SpawnReason spawnReason) -
Method Summary
Modifier and TypeMethodDescriptionReturns the Entity involved in this eventGets the reason for why the creature is being spawned.Methods inherited from class org.bukkit.event.entity.EntitySpawnEvent
getHandlerList, getHandlers, getLocation, isCancelled, setCancelledMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CreatureSpawnEvent
public CreatureSpawnEvent(@NotNull @NotNull LivingEntity spawnee, @NotNull @NotNull CreatureSpawnEvent.SpawnReason spawnReason)
-
-
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
-
getSpawnReason
Gets the reason for why the creature is being spawned.- Returns:
- A SpawnReason value detailing the reason for the creature being spawned
-