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 special chest in an arena.

Special chests include private and team chests. Cancelling this event will prevent the chest from being opened.

  • Constructor Details

    • PlayerOpenArenaChestEvent

      public PlayerOpenArenaChestEvent(Player player, Arena arena, Team team, Inventory inventory, Block chestBlock, boolean teamChest)
  • 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
    • getInventory

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

      This inventory is safe to modify. This is the inventory that is being shown - do not use the inventory of the block itself.

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

      public boolean isTeamChest()
      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

      public boolean isPrivateChest()
      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
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean bool)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlers

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

      public static HandlerList getHandlerList()