Class VanillaLivingEntityDropHeadEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- org.bukkit.event.entity.EntityEvent
-
- org.shininet.bukkit.playerheads.events.VanillaLivingEntityDropHeadEvent
-
- All Implemented Interfaces:
Cancellable
public class VanillaLivingEntityDropHeadEvent extends EntityEvent implements Cancellable
Event created by PlayerHeads when a [living] entity drops a head from a source outside of PlayerHeads. Note: this event does not currently check if the entity dropped the item from their inventory/equipment, or from an actual head drop.- Since:
- 5.2.14-SNAPSHOT
- Author:
- crashdemons (crashenator at gmail.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
-
Field Summary
-
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
-
Constructor Summary
Constructors Constructor Description VanillaLivingEntityDropHeadEvent(Event cause, LivingEntity entity, LivingEntity killer, List<ItemStack> drops)Creates the event
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EventgetCause()The event which inevitably triggered the beheading event (usually EntityDeathEvent)List<ItemStack>getDrops()Gets the items that will drop from the beheading.LivingEntitygetEntity()Gets the entity that was beheadedstatic HandlerListgetHandlerList()Get a list of handlers for the event.HandlerListgetHandlers()Get a list of handlers for the event.LivingEntitygetKillerEntity()The entity that is responsible for the beheading, as determined by PlayerHeads.booleanisCancelled()Whether the event has been cancelled.voidsetCancelled(boolean cancel)Sets whether the event should be cancelled.-
Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntityType
-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Constructor Detail
-
VanillaLivingEntityDropHeadEvent
public VanillaLivingEntityDropHeadEvent(Event cause, LivingEntity entity, LivingEntity killer, List<ItemStack> drops)
Creates the event- Parameters:
cause- the event that caused this one, or null.entity- the entity that dropped a headkiller- the entity that caused the beheading, as determined by PlayerHeads.drops- the head items dropped.
-
-
Method Detail
-
isCancelled
public boolean isCancelled()
Whether the event has been cancelled.- Specified by:
isCancelledin interfaceCancellable- Returns:
- Whether the event has been cancelled.
-
setCancelled
public void setCancelled(boolean cancel)
Sets whether the event should be cancelled.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- whether the event should be cancelled.
-
getCause
@Nullable public Event getCause()
The event which inevitably triggered the beheading event (usually EntityDeathEvent)- Returns:
- the event, or null.
- Since:
- 5.2.14-SNAPSHOT
-
getDrops
public List<ItemStack> getDrops()
Gets the items that will drop from the beheading. Note: changing this list will not impact dropped items, you must interact with the event through getCause().- Returns:
- ItemStacks that will drop into the world once this event is over
-
getEntity
public LivingEntity getEntity()
Gets the entity that was beheaded- Overrides:
getEntityin classEntityEvent- Returns:
- the beheaded entity
-
getKillerEntity
@Nullable public LivingEntity getKillerEntity()
The entity that is responsible for the beheading, as determined by PlayerHeads. It is possible that this differs from getEntity().getKiller() because it can identify non-player killers and search projectile and tame ownership, if configured. Use getEntity().getKiller() if you want the killer as determined by Minecraft.- Returns:
- the killerEntity's entity
- Since:
- 5.2.14-SNAPSHOT
-
getHandlers
public HandlerList getHandlers()
Get a list of handlers for the event.- Specified by:
getHandlersin classEvent- Returns:
- a list of handlers for the event
-
getHandlerList
public static HandlerList getHandlerList()
Get a list of handlers for the event.- Returns:
- a list of handlers for the event
-
-