Class EntityAttributeModifierRemoveEvent

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

public class EntityAttributeModifierRemoveEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
An event called when an existing modifier is being removed from an entity's attribute. This event is Cancellable, allowing listeners to prevent the removal of the modifier.
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    EntityAttributeModifierRemoveEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull Attribute attribute, @NotNull AttributeModifier modifier)
    Constructs a new EntityAttributeModifierRemoveEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Attribute
    Retrieves the specific attribute that the modifier is currently influencing.
    @NotNull org.bukkit.entity.Entity
    Retrieves the entity involved in this event.
    static org.bukkit.event.HandlerList
    Provides a static method to retrieve the handler list, required by Bukkit.
    @NotNull org.bukkit.event.HandlerList
    Retrieves the list of handlers listening to this event instance.
    Retrieves the modifier instance that is being removed.
    boolean
    Checks whether the removal of this modifier has been cancelled.
    void
    setCancelled(boolean v)
    Sets the cancellation state of the 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

    • EntityAttributeModifierRemoveEvent

      public EntityAttributeModifierRemoveEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Attribute attribute, @NotNull @NotNull AttributeModifier modifier)
      Constructs a new EntityAttributeModifierRemoveEvent.
      Parameters:
      entity - The Entity losing the modifier.
      attribute - The Attribute instance being updated.
      modifier - The AttributeModifier instance that was found and is being removed.
  • Method Details

    • getEntity

      @NotNull public @NotNull org.bukkit.entity.Entity getEntity()
      Retrieves the entity involved in this event.
      Returns:
      The Entity whose attribute is being updated.
    • getAttribute

      @NotNull public @NotNull Attribute getAttribute()
      Retrieves the specific attribute that the modifier is currently influencing.
      Returns:
      The Attribute definition.
    • getModifier

      @NotNull public @NotNull AttributeModifier getModifier()
      Retrieves the modifier instance that is being removed.
      Returns:
      The AttributeModifier instance.
    • isCancelled

      public boolean isCancelled()
      Checks whether the removal of this modifier has been cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      True if the removal is prevented.
    • 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 removal, keeping the modifier active.
    • getHandlers

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

      public static org.bukkit.event.HandlerList getHandlerList()
      Provides a static method to retrieve the handler list, required by Bukkit.
      Returns:
      The static HandlerList for this event type.