Class 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.

  • Constructor Details

  • Method Details

    • getEntity

      @NotNull public 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 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