Class LootDropEvent
java.lang.Object
org.bukkit.event.Event
dev.aurelium.auraskills.api.event.loot.LootDropEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class LootDropEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when AuraSkills drops extra loot from mechanics like Fishing, Luck, and custom loot tables.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionLootDropEvent(org.bukkit.entity.Player player, SkillsUser user, org.bukkit.entity.Entity entity, org.bukkit.Location location, LootDropEvent.Cause cause) LootDropEvent(org.bukkit.entity.Player player, SkillsUser user, org.bukkit.inventory.ItemStack item, org.bukkit.Location location, LootDropEvent.Cause cause, boolean toInventory) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Gets theLootDropEvent.Causethat initiated the loot drop.@Nullable org.bukkit.entity.EntityGets the spawned entity if the loot was an entity.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListorg.bukkit.inventory.ItemStackgetItem()Gets the item that will be dropped by the event.org.bukkit.LocationGets the location that the item will be dropped at in the world.org.bukkit.entity.PlayerGets the player that caused the loot drop.getUser()Gets theSkillsUserof the player that cause the loot drop.booleanbooleanGets whether the item will go directly into the player's inventory instead of being dropped in the world.voidsetCancelled(boolean cancelled) setItem(org.bukkit.inventory.ItemStack item) Sets the item dropped by the event.setLocation(org.bukkit.Location location) Sets the location in the world that the item should be dropped at.voidsetToInventory(boolean toInventory) Sets whether the drop should go directly to the player's inventory instead of being dropped in the world.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
LootDropEvent
public LootDropEvent(org.bukkit.entity.Player player, SkillsUser user, org.bukkit.inventory.ItemStack item, org.bukkit.Location location, LootDropEvent.Cause cause, boolean toInventory) -
LootDropEvent
public LootDropEvent(org.bukkit.entity.Player player, SkillsUser user, org.bukkit.entity.Entity entity, org.bukkit.Location location, LootDropEvent.Cause cause)
-
-
Method Details
-
getEntity
@Nullable public @Nullable org.bukkit.entity.Entity getEntity()Gets the spawned entity if the loot was an entity.- Returns:
- the entity
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player that caused the loot drop.- Returns:
- the player
-
getUser
Gets theSkillsUserof the player that cause the loot drop.- Returns:
- the user
-
getItem
public org.bukkit.inventory.ItemStack getItem()Gets the item that will be dropped by the event. If the drop is an entity, this will be AIR.- Returns:
- the item
-
setItem
Sets the item dropped by the event.- Parameters:
item- the item to be dropped- Returns:
- the event
-
getLocation
public org.bukkit.Location getLocation()Gets the location that the item will be dropped at in the world.- Returns:
- the location
-
setLocation
Sets the location in the world that the item should be dropped at.- Parameters:
location- the location to drop- Returns:
- the event
-
getCause
Gets theLootDropEvent.Causethat initiated the loot drop.- Returns:
- the cause
-
isToInventory
public boolean isToInventory()Gets whether the item will go directly into the player's inventory instead of being dropped in the world.- Returns:
- whether the drop goes directly to the player's inventory
-
setToInventory
public void setToInventory(boolean toInventory) Sets whether the drop should go directly to the player's inventory instead of being dropped in the world. If the player's inventory cannot fit the entire ItemStack, the rest will be dropped in the world.- Parameters:
toInventory- true to go to inventory, false if not
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-