Class CustomEntitySpawnEvent

java.lang.Object
org.bukkit.event.Event
com.github.darksoulq.abyssallib.server.event.custom.entity.CustomEntitySpawnEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class CustomEntitySpawnEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Custom event triggered when a custom CustomEntity is spawned into the world.

This event is cancellable, allowing control over whether the spawn should proceed.

  • Constructor Details

    • CustomEntitySpawnEvent

      public CustomEntitySpawnEvent(@NotNull @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, @NotNull @NotNull CustomEntitySpawnEvent.SpawnReason reason)
      Constructs a new EntitySpawnEvent.
      Parameters:
      entity - The custom entity being spawned.
      reason - The reason for the entity's spawn.
  • Method Details

    • getEntity

      @NotNull public @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> getEntity()
      Gets the custom entity being spawned.
      Returns:
      The entity being spawned.
    • getReason

      @NotNull public @NotNull CustomEntitySpawnEvent.SpawnReason getReason()
      Gets the reason for this entity's spawn.
      Returns:
      The spawn reason.
    • isCancelled

      public boolean isCancelled()
      Checks whether the event is cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true if the event is cancelled, false otherwise.
    • setCancelled

      public void setCancelled(boolean v)
      Sets the cancellation state of the event.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      v - true to cancel the event, false to allow it.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handler list.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()