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 enum`
`CreatureSpawnEvent.SpawnReason`
An enum to specify the type of spawning

## Nested 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

Constructors
Constructor
Description
`CreatureSpawnEvent(@NotNull LivingEntity spawnee, @NotNull CreatureSpawnEvent.SpawnReason spawnReason)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull LivingEntity`
`getEntity()`
Returns the Entity involved in this event
`@NotNull CreatureSpawnEvent.SpawnReason`
`getSpawnReason()`
Gets the reason for why the creature is being spawned.

### Methods inherited from class org.bukkit.event.entity.EntitySpawnEvent

`getHandlerList, getHandlers, getLocation, isCancelled, setCancelled`

### Methods inherited from class org.bukkit.event.entity.EntityEvent

`getEntityType`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CreatureSpawnEvent

public CreatureSpawnEvent(@NotNull @NotNull LivingEntity spawnee, @NotNull @NotNull CreatureSpawnEvent.SpawnReason spawnReason)

## Method Details

### getEntity

@NotNull public @NotNull LivingEntity getEntity()
Description copied from class: `EntityEvent`
Returns the Entity involved in this event

Overrides:
  `getEntity` in class `EntityEvent`
Returns:
  Entity who is involved in this event

### getSpawnReason

@NotNull public @NotNull CreatureSpawnEvent.SpawnReason getSpawnReason()
Gets the reason for why the creature is being spawned.

Returns:
  A SpawnReason value detailing the reason for the creature being spawned