Class BagEtherealCreateEvent

java.lang.Object
org.bukkit.event.Event
valorless.havenbags.events.BagEtherealCreateEvent

public class BagEtherealCreateEvent extends org.bukkit.event.Event
Called when a new ethereal HavenBag is created.

This event is triggered after the bag has been successfully created and assigned to the player, but before any items are added to it. The bag is represented by a unique ID and key, and its settings can be accessed via the EtherealBagSettings object. The player receiving the bag and the command sender who issued the creation command are also provided. The bag starts empty, and items can be added afterward. The bag's inventory can be accessed and modified using the provided uuid and bagId, or using the bagKey, which includes both the uuid and bagId. The bag's settings can be modified via the EtherealBagSettings object.

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

    Constructors
    Constructor
    Description
    BagEtherealCreateEvent(org.bukkit.entity.Player player, org.bukkit.command.CommandSender sender, String bagId, String bagKey, EtherealBagSettings bagSettings)
    Constructs a new BagCreateEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the unique identifier for the created bag.
    Gets the unique key associated with the created bag.
    Gets the settings/configuration of the created ethereal 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 received the bag.
    org.bukkit.command.CommandSender
    Gets the command sender who issued the bag creation.
    Gets the unique identifier (UUID) of the player who received the bag.
    setContents(List<org.bukkit.inventory.ItemStack> contents)
     

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BagEtherealCreateEvent

      public BagEtherealCreateEvent(org.bukkit.entity.Player player, org.bukkit.command.CommandSender sender, String bagId, String bagKey, EtherealBagSettings bagSettings)
      Constructs a new BagCreateEvent.
      Parameters:
      player - The player who received the bag.
      sender - The command sender who issued the bag creation.
      bagId - The unique identifier for the created bag.
      bagKey - The unique key associated with the created bag.
      bagSettings - The settings/configuration of the created ethereal bag.
  • Method Details

    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Required boilerplate: returns the list of handlers listening to this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      HandlerList for BagEtherealCreateEvent
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Required boilerplate: returns the static HandlerList for this event type.
      Returns:
      HandlerList for BagEtherealCreateEvent
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player who received the bag.
      Returns:
      The player who received the bag.
    • getSender

      public org.bukkit.command.CommandSender getSender()
      Gets the command sender who issued the bag creation.
      Returns:
      The command sender who issued the bag creation.
    • getUuid

      public UUID getUuid()
      Gets the unique identifier (UUID) of the player who received the bag.
      Returns:
      The UUID of the player who received the bag.
    • getBagId

      public String getBagId()
      Gets the unique identifier for the created bag.
      Returns:
      The unique identifier for the created bag.
    • getBagKey

      public String getBagKey()
      Gets the unique key associated with the created bag.
      Returns:
      The unique key associated with the created bag.
    • getBagSettings

      public EtherealBagSettings getBagSettings()
      Gets the settings/configuration of the created ethereal bag.
      Returns:
      The EtherealBagSettings object containing the bag's settings.
    • setContents

      public Boolean setContents(List<org.bukkit.inventory.ItemStack> contents)