Package valorless.havenbags.events
Class BagCloseEvent
java.lang.Object
org.bukkit.event.Event
valorless.havenbags.events.BagCloseEvent
public class BagCloseEvent
extends org.bukkit.event.Event
Called when a player closes a HavenBag inventory.
This event provides access to the Player, the Inventory that was closed,
the bag ItemStack, and the corresponding Data object storing bag metadata.
Use this event to handle cleanup, saving, or triggering custom logic when a bag is closed.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionBagCloseEvent(org.bukkit.inventory.Inventory inventory, org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack bagItem, Data bagData, boolean forced) Constructs a new BagCloseEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets theDataassociated with the bag.org.bukkit.inventory.ItemStackGets the ItemStack representing the bag.static org.bukkit.event.HandlerListRequired boilerplate: returns the static HandlerList for this event type.org.bukkit.event.HandlerListRequired boilerplate: returns the list of handlers listening to this event.org.bukkit.inventory.InventoryGets the bag inventory that was closed.org.bukkit.entity.PlayerGets the player who closed the bag.booleanMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
BagCloseEvent
public BagCloseEvent(org.bukkit.inventory.Inventory inventory, org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack bagItem, Data bagData, boolean forced) Constructs a new BagCloseEvent.- Parameters:
inventory- The bag's inventory that was closedplayer- The player who closed the bagbagItem- The ItemStack representing the bagbagData- The bag's associatedDataforced-
-
-
Method Details
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Required boilerplate: returns the list of handlers listening to this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- HandlerList for BagCloseEvent
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Required boilerplate: returns the static HandlerList for this event type.- Returns:
- HandlerList for BagCloseEvent
-
getInventory
public org.bukkit.inventory.Inventory getInventory()Gets the bag inventory that was closed.- Returns:
- The closed inventory
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player who closed the bag.- Returns:
- The player who closed the inventory
-
getBagItem
public org.bukkit.inventory.ItemStack getBagItem()Gets the ItemStack representing the bag.- Returns:
- The bag ItemStack
-
getBagData
Gets theDataassociated with the bag.- Returns:
- The bag data
-
isForceClosed
public boolean isForceClosed()
-