Class CustomEntityDeathEvent

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

public class CustomEntityDeathEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Custom event triggered when an CustomEntity dies.

This event is Cancellable, allowing plugins to prevent entity death behavior.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomEntityDeathEvent(@NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, org.bukkit.entity.Entity killer)
    Constructs a new EntityDeathEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity>
    Gets the custom entity that is dying.
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
    Gets the list of handlers for this event.
    org.bukkit.entity.Entity
    Gets the Bukkit entity responsible for the kill.
    boolean
    Checks if the event is cancelled.
    void
    setCancelled(boolean v)
    Sets the cancellation state of this event.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomEntityDeathEvent

      public CustomEntityDeathEvent(@NotNull @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, @Nullable org.bukkit.entity.Entity killer)
      Constructs a new EntityDeathEvent.
      Parameters:
      entity - The custom entity that is dying.
      killer - The Bukkit entity that killed it, or null if there is none.
  • Method Details

    • getEntity

      @NotNull public @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> getEntity()
      Gets the custom entity that is dying.
      Returns:
      The dying entity.
    • getKiller

      @Nullable public org.bukkit.entity.Entity getKiller()
      Gets the Bukkit entity responsible for the kill.
      Returns:
      The killer entity, or null if there was no killer.
    • isCancelled

      public boolean isCancelled()
      Checks if 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 this event.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      v - true to cancel the event, false to let it proceed.
    • 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()