Class PlayerOpenArenaChestEvent
- All Implemented Interfaces:
ArenaEvent
,Cancellable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of chest that has been interacted with.static enum
The purpose of the chest opening.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerOpenArenaChestEvent
(Player player, Arena arena, Team team, Supplier<Inventory> inventory, Block chestBlock, PlayerOpenArenaChestEvent.ChestType chestType, PlayerOpenArenaChestEvent.OpenPurpose purpose) PlayerOpenArenaChestEvent
(Player player, Arena arena, Team team, Inventory inventory, Block chestBlock, PlayerOpenArenaChestEvent.ChestType chestType, PlayerOpenArenaChestEvent.OpenPurpose purpose) -
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Returns the Arena in which the chest is locatedReturn the block the player clicked on to open the chestReturns the type of chest that has been interacted with.static HandlerList
The inventory that holds the contents of the chest.Returns the purpose of the chest opening.getTeam()
Returns the player's Teamboolean
Deprecated.boolean
Deprecated.UsegetChestType()
insteadMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
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
Methods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerOpenArenaChestEvent
public PlayerOpenArenaChestEvent(Player player, Arena arena, Team team, Inventory inventory, Block chestBlock, PlayerOpenArenaChestEvent.ChestType chestType, PlayerOpenArenaChestEvent.OpenPurpose purpose) -
PlayerOpenArenaChestEvent
public PlayerOpenArenaChestEvent(Player player, Arena arena, Team team, Supplier<Inventory> inventory, Block chestBlock, PlayerOpenArenaChestEvent.ChestType chestType, PlayerOpenArenaChestEvent.OpenPurpose purpose)
-
-
Method Details
-
getArena
Returns the Arena in which the chest is located- Specified by:
getArena
in interfaceArenaEvent
- Returns:
- the arena in which the chest is located
-
getTeam
Returns the player's Team- Returns:
- the Team of the player opening the chest
-
getChestBlock
Return the block the player clicked on to open the chest- Returns:
- the chest block
-
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
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 notPlayerOpenArenaChestEvent.ChestType.VANILLA
).- Returns:
- The inventory related to the speciality type of the chest
-
isTeamChest
Deprecated.UsegetChestType()
insteadReturns whether the chest is a team chestNote that users have team chests disabled in the config, this will always return false.
- Returns:
- If the chest belongs to the team
-
isPrivateChest
Deprecated.UsegetChestType()
insteadReturns whether the chest is a private chestThis 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
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
getChestType()
instead