Class EntityAttributeModifierRemoveEvent<T extends Number>
java.lang.Object
org.bukkit.event.Event
com.github.darksoulq.abyssallib.server.event.custom.entity.EntityAttributeModifierRemoveEvent<T>
- Type Parameters:
T- The numeric type of the attribute and the modifier being removed.
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class EntityAttributeModifierRemoveEvent<T extends Number>
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<T> attribute, @NotNull net.kyori.adventure.key.Key modifierId, @NotNull AttributeModifier<T> modifier) Constructs a new EntityAttributeModifierRemoveEvent. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves 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 AttributeModifier<T> Retrieves the modifier instance that is being removed.@NotNull net.kyori.adventure.key.KeyRetrieves the unique identifier Key for the modifier 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<T> attribute, @NotNull @NotNull net.kyori.adventure.key.Key modifierId, @NotNull @NotNull AttributeModifier<T> modifier) Constructs a new EntityAttributeModifierRemoveEvent.- Parameters:
entity- TheEntitylosing the modifier.attribute- TheAttributeinstance being updated.modifierId- The uniqueKeyidentifying the modifier to remove.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
-
getModifierId
@NotNull public @NotNull net.kyori.adventure.key.Key getModifierId()Retrieves the unique identifier Key for the modifier being removed.- Returns:
- The modifier's unique
Key.
-
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.
-