Class EntityDeathByCauldronEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
wtf.choco.alchema.api.event.entity.EntityDeathByCauldronEvent

public class EntityDeathByCauldronEvent
extends org.bukkit.event.entity.EntityEvent
Called when a LivingEntity is damaged and killed by an AlchemicalCauldron. Whether or not the entity drops essence into the cauldron depends on if any essence data is registered to the EntityEssenceEffectRegistry. This event is called whether or not essence is inserted, though essence may be 0.
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
    EntityDeathByCauldronEvent​(@NotNull org.bukkit.entity.LivingEntity entity, @NotNull AlchemicalCauldron cauldron, int essence)
  • Method Summary

    Modifier and Type Method Description
    @NotNull AlchemicalCauldron getCauldron()
    Get the AlchemicalCauldron involved in this event.
    @NotNull org.bukkit.entity.LivingEntity getEntity()  
    int getEssence()
    Get the amount of essence to be inserted into the cauldron.
    static @NotNull org.bukkit.event.HandlerList getHandlerList()
    Get the HandlerList instance for this event.
    @NotNull org.bukkit.event.HandlerList getHandlers()  
    void setEssence​(int essence)
    Set the amount of essence to be inserted into the cauldron.

    Methods inherited from class org.bukkit.event.entity.EntityEvent

    getEntityType

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityDeathByCauldronEvent

      public EntityDeathByCauldronEvent​(@NotNull @NotNull org.bukkit.entity.LivingEntity entity, @NotNull @NotNull AlchemicalCauldron cauldron, int essence)
      Parameters:
      entity - the entity damaged by the cauldron
      cauldron - the cauldron that inflicted the damage
      essence - the amount of essence to be inserted into the cauldron
  • Method Details

    • getEntity

      @NotNull public @NotNull org.bukkit.entity.LivingEntity getEntity()
      Overrides:
      getEntity in class org.bukkit.event.entity.EntityEvent
    • getCauldron

      @NotNull public @NotNull AlchemicalCauldron getCauldron()
      Get the AlchemicalCauldron involved in this event.
      Returns:
      the cauldron
    • setEssence

      public void setEssence​(int essence)
      Set the amount of essence to be inserted into the cauldron. If the entity being killed does not have any entity essence registered in the EntityEssenceEffectRegistry, this value will have no effect.
      Parameters:
      essence - the essence to set
    • getEssence

      public int getEssence()
      Get the amount of essence to be inserted into the cauldron.
      Returns:
      the amount of essence
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Get the HandlerList instance for this event.
      Returns:
      the handler list