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
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.
-
Nested Class Summary
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
-
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Returns the Arena in which the chest is locatedReturn the block the player clicked on to open the cheststatic HandlerList
The inventory that holds the contents of the special chest.getTeam()
Returns the player's Teamboolean
boolean
Returns whether the chest is a private chestboolean
Returns whether the chest is a team chestvoid
setCancelled
(boolean bool) Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerOpenArenaChestEvent
-
-
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
-
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 chestNote 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 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
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean bool) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-