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
ConstructorsConstructorDescriptionCustomEntityDeathEvent(@NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, org.bukkit.entity.Entity killer) Constructs a newEntityDeathEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> Gets the custom entity that is dying.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the list of handlers for this event.org.bukkit.entity.EntityGets the Bukkit entity responsible for the kill.booleanChecks if the event is cancelled.voidsetCancelled(boolean v) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CustomEntityDeathEvent
public CustomEntityDeathEvent(@NotNull @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, @Nullable org.bukkit.entity.Entity killer) Constructs a newEntityDeathEvent.- Parameters:
entity- The custom entity that is dying.killer- The Bukkit entity that killed it, ornullif there is none.
-
-
Method Details
-
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
nullif there was no killer.
-
isCancelled
public boolean isCancelled()Checks if the event is cancelled.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
trueif the event is cancelled;falseotherwise.
-
setCancelled
public void setCancelled(boolean v) Sets the cancellation state of this event.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
v-trueto cancel the event,falseto let it proceed.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers for this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- The handler list.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-