Package valorless.havenbags.events
Class BagCreateEvent
java.lang.Object
org.bukkit.event.Event
valorless.havenbags.events.BagCreateEvent
public class BagCreateEvent
extends org.bukkit.event.Event
Called when a new HavenBag is created.
This event provides access to the Player
who created the bag,
the bag ItemStack
, and the corresponding Data
object storing bag metadata.
Use this event to handle setup, logging, or applying custom modifications whenever a bag is first created.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionBagCreateEvent
(org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack bagItem, Data bagData) Constructs a new BagCreateEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets theData
associated with the bag.org.bukkit.inventory.ItemStack
Gets the ItemStack representing the newly created bag.static org.bukkit.event.HandlerList
Required boilerplate: returns the static HandlerList for this event type.org.bukkit.event.HandlerList
Required boilerplate: returns the list of handlers listening to this event.org.bukkit.entity.Player
Gets the player who created the bag.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
Method Details
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Required boilerplate: returns the list of handlers listening to this event.- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- HandlerList for BagCreateEvent
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Required boilerplate: returns the static HandlerList for this event type.- Returns:
- HandlerList for BagCreateEvent
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player who created the bag.- Returns:
- The player
-
getBagItem
public org.bukkit.inventory.ItemStack getBagItem()Gets the ItemStack representing the newly created bag.- Returns:
- The bag ItemStack
-
getBagData
Gets theData
associated with the bag.- Returns:
- The bag data
-