Class PlayerPostEffectsModifyEvent
java.lang.Object
fr.fidorial.event.player.PlayerPostEffectsModifyEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
Fired right before a player has their post effects modified.
Cancelling the event keeps their current post effects.
- Since:
- 0.1.0
- API Note:
- the event is not fired whenever the underlying list of post effects hasn't changed
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat triggered the change in the player's active post effects -
Constructor Summary
ConstructorsConstructorDescriptionPlayerPostEffectsModifyEvent(Player player, PlayerPostEffectsModifyEvent.Cause cause, List<Key> currentPostEffects, List<Key> newPostEffects) Creates an event. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns what triggered the change in active post effects.Returns the current active post effects.booleanReturnstrueif the action this event describes will not happen.Returns the new post effects.player()Returns the player involved in this event.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.
-
Constructor Details
-
PlayerPostEffectsModifyEvent
@Internal public PlayerPostEffectsModifyEvent(Player player, PlayerPostEffectsModifyEvent.Cause cause, List<Key> currentPostEffects, List<Key> newPostEffects) Creates an event.- Parameters:
player- the player whose post effects are about to be changedcause- what triggered the change in active post effectscurrentPostEffects- the currently active post effectsnewPostEffects- the post effects about to be applied- Since:
- 0.1.0
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
newPostEffects
Returns the new post effects.- Returns:
- the new post effects
- Since:
- 0.1.0
-
currentPostEffects
Returns the current active post effects.- Returns:
- the current active post effects
- Since:
- 0.1.0
-
cause
Returns what triggered the change in active post effects.- Returns:
- what triggered the change in active post effects
- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-