Class PlayerOpenArenaChestEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerOpenArenaChestEvent
All Implemented Interfaces:
ArenaEvent, Cancellable

public class PlayerOpenArenaChestEvent extends PlayerEvent implements ArenaEvent, Cancellable
Gets called when a player is opening a chest in an arena.

Special chests include private and team chests. This event also gets called for vanilla chests (without special behavior), e.g. trapped chests or shulker boxes (furnaces etc. are excluded and do not count as chests). The exact behavior depends on the configurations of the server. Cancelling this event will prevent the chest from being opened.

  • Constructor Details

  • Method Details

    • getArena

      public Arena getArena()
      Returns the Arena in which the chest is located
      Specified by:
      getArena in interface ArenaEvent
      Returns:
      the arena in which the chest is located
    • getTeam

      public Team getTeam()
      Returns the player's Team
      Returns:
      the Team of the player opening the chest
    • getChestBlock

      public Block getChestBlock()
      Return the block the player clicked on to open the chest
      Returns:
      the chest block
    • getChestType

      public PlayerOpenArenaChestEvent.ChestType getChestType()
      Returns the type of chest that has been interacted with.
      Returns:
      the type of chest that has been interacted with
    • getPurpose

      Returns the purpose of the chest opening.
      Returns:
      The purpose of the chest opening
    • getInventory

      public Inventory getInventory()
      The inventory that holds the contents of the chest.

      This inventory is safe to modify. This is the inventory that is being shown - do not use the inventory of the block itself, as it may not be the same (if getChestType() is not PlayerOpenArenaChestEvent.ChestType.VANILLA).

      Returns:
      The inventory related to the speciality type of the chest
    • isTeamChest

      @Deprecated public boolean isTeamChest()
      Deprecated.
      Use getChestType() instead
      Returns whether the chest is a team chest

      Note that users have team chests disabled in the config, this will always return false.

      Returns:
      If the chest belongs to the team
    • isPrivateChest

      @Deprecated public boolean isPrivateChest()
      Deprecated.
      Use getChestType() instead
      Returns whether the chest is a private chest

      This is usually the case for ender chests, although admins may turn them into (depending on their configuration) team chests as well.

      Returns:
      If the chest is a private chest
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()