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
ConstructorsConstructorDescriptionEntityAttributeModifierRemoveEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull Attribute attribute, @NotNull AttributeModifier modifier) Constructs a new EntityAttributeModifierRemoveEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull AttributeRetrieves the specific attribute that the modifier is currently influencing.@NotNull org.bukkit.entity.EntityRetrieves the entity involved in this event.static org.bukkit.event.HandlerListProvides a static method to retrieve the handler list, required by Bukkit.@NotNull org.bukkit.event.HandlerListRetrieves the list of handlers listening to this event instance.@NotNull AttributeModifierRetrieves the modifier instance that is being removed.booleanChecks whether the removal of this modifier has been cancelled.voidsetCancelled(boolean v) Sets the cancellation state of the event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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- TheEntitylosing the modifier.attribute- TheAttributeinstance being updated.modifier- TheAttributeModifierinstance 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
Entitywhose attribute is being updated.
-
getAttribute
-
getModifier
Retrieves the modifier instance that is being removed.- Returns:
- The
AttributeModifierinstance.
-
isCancelled
public boolean isCancelled()Checks whether the removal of this modifier has been cancelled.- Specified by:
isCancelledin interfaceorg.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:
setCancelledin interfaceorg.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:
getHandlersin classorg.bukkit.event.Event- Returns:
- The
HandlerListfor 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
HandlerListfor this event type.
-