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 classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionLootDropEvent
(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.Cause
that initiated the loot drop.static org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
org.bukkit.inventory.ItemStack
getItem()
Gets the item that will be dropped by the event.org.bukkit.Location
Gets the location that the item will be dropped at in the world.org.bukkit.entity.Player
Gets the player that caused the loot drop.getUser()
Gets theSkillsUser
of the player that cause the loot drop.boolean
boolean
Gets whether the item will go directly into the player's inventory instead of being dropped in the world.void
setCancelled
(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.void
setToInventory
(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)
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player that caused the loot drop.- Returns:
- the player
-
getUser
Gets theSkillsUser
of 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.- 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.Cause
that 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:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-