Class PlayerConsumeEntityEssenceEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
wtf.choco.alchema.api.event.player.PlayerConsumeEntityEssenceEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class PlayerConsumeEntityEssenceEvent
extends org.bukkit.event.player.PlayerEvent
implements org.bukkit.event.Cancellable
Called when a player consumes a vial of entity essence and has applied an effect.
This event is still called even if the entity essence data is tasteless and does
not apply an effect to the player. If cancelled, the vial of essence is not
consumed.
- Author:
- Parker Hawke - Choco
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
Constructors Constructor Description PlayerConsumeEntityEssenceEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull EntityEssenceData essenceData)Construct a newPlayerConsumeEntityEssenceEvent. -
Method Summary
Modifier and Type Method Description @NotNull EntityEssenceDatagetEssenceData()Get the entity essence data that was consumed.static @NotNull org.bukkit.event.HandlerListgetHandlerList()Get the HandlerList instance for this event.@NotNull org.bukkit.event.HandlerListgetHandlers()@NotNull org.bukkit.inventory.ItemStackgetItem()Get the vial of entity essenceItemStackthat was consumed to cause this event.booleanisCancelled()voidsetApplyEffect(boolean applyEffect)Set whether or not this event should apply the effect of the entity essence data.voidsetCancelled(boolean cancel)booleanshouldApplyEffect()Check whether or not this event should apply the effect of the entity essence data.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PlayerConsumeEntityEssenceEvent
public PlayerConsumeEntityEssenceEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull EntityEssenceData essenceData)Construct a newPlayerConsumeEntityEssenceEvent.- Parameters:
player- the player that consumed the essenceitem- the item that was consumedessenceData- the essence data that was consumed
-
-
Method Details
-
getItem
@NotNull public @NotNull org.bukkit.inventory.ItemStack getItem()Get the vial of entity essenceItemStackthat was consumed to cause this event.- Returns:
- the item
-
getEssenceData
Get the entity essence data that was consumed.- Returns:
- the essence data
-
setApplyEffect
public void setApplyEffect(boolean applyEffect)Set whether or not this event should apply the effect of the entity essence data. If set to false, the vial will be consumed (assumingisCancelled()isfalse) but the effect will not apply.- Parameters:
applyEffect- whether or not to apply the effect
-
shouldApplyEffect
public boolean shouldApplyEffect()Check whether or not this event should apply the effect of the entity essence data.- Returns:
- true if the effect should apply, false otherwise
-
setCancelled
public void setCancelled(boolean cancel)- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Get the HandlerList instance for this event.- Returns:
- the handler list
-