Cancellablepublic class EntityPotionEffectEvent extends EntityEvent implements Cancellable
If the event is cancelled, no change will be made on the entity.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
EntityPotionEffectEvent.Action |
An enum to specify the action to be performed.
|
static class |
EntityPotionEffectEvent.Cause |
An enum to specify the cause why an effect was changed.
|
Event.Resultentity| Constructor | Description |
|---|---|
EntityPotionEffectEvent(LivingEntity livingEntity,
PotionEffect oldEffect,
PotionEffect newEffect,
EntityPotionEffectEvent.Cause cause,
EntityPotionEffectEvent.Action action,
boolean override) |
| Modifier and Type | Method | Description |
|---|---|---|
EntityPotionEffectEvent.Action |
getAction() |
Gets the action which will be performed on the potion effect type.
|
EntityPotionEffectEvent.Cause |
getCause() |
Gets the cause why the effect has changed.
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
PotionEffectType |
getModifiedType() |
Gets the modified potion effect type.
|
PotionEffect |
getNewEffect() |
Gets new potion effect of the changed type to be applied.
|
PotionEffect |
getOldEffect() |
Gets the old potion effect of the changed type, which will be removed.
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
boolean |
isOverride() |
Returns if the new potion effect will override the old potion effect
(Only applicable for the CHANGED Action).
|
void |
setCancelled(boolean cancel) |
Sets the cancellation state of this event.
|
void |
setOverride(boolean override) |
Sets if the new potion effect will override the old potion effect (Only
applicable for the CHANGED action).
|
getEntity, getEntityTypegetEventName, isAsynchronouspublic EntityPotionEffectEvent(LivingEntity livingEntity, PotionEffect oldEffect, PotionEffect newEffect, EntityPotionEffectEvent.Cause cause, EntityPotionEffectEvent.Action action, boolean override)
public PotionEffect getOldEffect()
public PotionEffect getNewEffect()
public EntityPotionEffectEvent.Cause getCause()
public EntityPotionEffectEvent.Action getAction()
public PotionEffectType getModifiedType()
public boolean isOverride()
public void setOverride(boolean override)
override - If the new effect will override the old one.public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this eventpublic HandlerList getHandlers()
getHandlers in class Eventpublic static HandlerList getHandlerList()
Copyright © 2018. All rights reserved.