Interface GameAPI
-
Method Summary
Modifier and TypeMethodDescriptionReturns a builder to create and add an arena.voiddrawBorder(XYZ min, XYZ max, Player player) Draw a cube border once.booleanforceLobbyHotbarRefresh(Player player) Forcefully refresh the hotbar of a player during lobby phase.static GameAPIget()Returns the global GameAPI instance.@Nullable ArenagetArenaByExactName(String name) Looks for an arena with exactly that name.@Nullable Collection<Arena> getArenaByLocation(Location location) Looks for all arenas where the location is inside the arena.@Nullable ArenagetArenaByName(String name) Looks for an arena with that name and optionally parses it as an arena picker.@Nullable ArenagetArenaByPlayer(Player player) Looks for an arena with that player inside the arena.@Nullable ArenagetArenaBySpectator(Player player) Looks for an arena with that player spectating the arena.Returns all existing arenas.@Nullable BuyGroupgetBuyGroup(String name) Tries to locate and return aBuyGroupby its nameReturns all existing buy groupsReturns theArenaCloningManagerwhose purpose it is to automatically clone new arenas.@Nullable UUIDgetCompanionOwner(Entity entity) Get the UUID of the player who owns the given companion.Returns all registered custom spawner handlers.Returns the default handler for scoreboards that's being provided by the plugin.Returns the defaultShopLayoutthat's being used whenever the player clicks on the dealerReturns the defaultUpgradeShopLayoutthat's being used whenever the player clicks on the upgrade dealer@Nullable DropTypeTries to find a DropType who could've dropped the itemis@Nullable DropTypeTries to find a DropType given by its id.Returns all currently existing drop type.@Nullable PlayerDamageInfogetLastPlayerCausedDamage(Player damaged) Get the info of the last directly/indirectly player-caused damage during a match.@Nullable InstantGet the last time the player had used theSpecialItemType.TELEPORTERspecial item.@Nullable LobbyItemHandlerReturns a registered item handler whos id is equal to the passed one.Returns all registered handlers.Collection<? extends LobbyItem> Returns all existingLobbyItems.@Nullable Collection<? extends LobbyItem> getLobbyItems(int slot) Returns allLobbyItems that were added to a specific slot.Returns the current handler for scoreboards.@Nullable ShopItemTries to locate and return aShopItemby its id.Returns all existing items inside the shop@Nullable ShopLayoutgetShopLayout(String layoutName) Tries to look up for a registered layout that has the given name.Returns all existing layouts for the shopReturns all existing pages inside the shop@Nullable SpecialItemgetSpecialItem(String id) Tries to locate and return aSpecialItemgiven by its id.@Nullable SpecialItemgetSpecialItem(ItemStack itemStack) Tries to locate and return aSpecialItemgiven by its usable item.Returns all registered (including the default ones) SpecialItems.Returns all players who are currently spectating.@Nullable SpectatorgetSpectatorByPlayer(Player player) Tries to find the corresponding Spectator instance given by its player.@Nullable SpectatorItemgetSpectatorItem(int slot) Returns a hotbar slot given by its slot.@Nullable SpectatorItemHandlerReturns a registered item handler whos id is equal to the passed one.Returns all registered handlers.Returns the spectator data of every player who is currently spectating.Returns all the upgrades that are currently loaded.@Nullable UpgradeShopLayoutgetUpgradeShopLayout(String layoutName) Tries to look up for a registered layout that has the given name.Returns all existing layouts for the upgrade shop@Nullable UpgradeTriggerHandlerTries to locate and return aUpgradeTriggerHandlergiven by its id.Returns all registered (including the default ones) UpgradeTriggerHandlers.@Nullable LobbyItemgetVisibleLobbyItem(int slot, Player player, Arena arena) Returns the currently visible item at a specific slot.booleanisArenaNameValid(String name) Returns weather or not the given String can be used as the name for an arenabooleanPlugin might mark blocks as player placed depending on their configuration.booleanisSpectator(Player player) Get whether the player is currently spectating.voidopenAchievementsGUI(Player player) Opens the AchievementsGUI for a playerdefault voidOpens the shop for a player.default voidopenShop(Player player, ShopLayout layout) Opens the shop for a player.default voidopenShop(Player player, ShopLayout layout, ShopOpenCause cause) Opens the shop for a player.voidopenShop(Player player, ShopLayout layout, ShopOpenCause cause, @Nullable ShopPage shopPage) Opens the shop for a player.default voidopenShop(Player player, ShopOpenCause cause) Opens the shop for a player.booleanopenUpgradeShop(Player player) Opens the upgrade shop for a player.booleanopenUpgradeShop(Player player, Arena arena, Team team, UpgradeShopOpenCause cause) Opens the upgrade shop for a player.booleanRegisters the custom spawner handler.booleanregisterLobbyItemHandler(LobbyItemHandler handler) Registers a handler forLobbyItems.booleanregisterShopLayout(ShopLayout layout) Create and register your own custom ShopLayout using this method.booleanregisterSpecialItem(SpecialItem specialItem) Reregisters a SpecialItem that previously has been unregistered.@Nullable SpecialItemregisterSpecialItem(String id, Plugin plugin, String name, ItemStack item) Registers a customSpecialItemfor the later ingame use.booleanRegisters a handler forSpectatorItems.booleanCreate and register your own custom UpgradeShopLayout using this method.booleanRegisters a customUpgradeTriggerHandlerfor use in the upgradeshop.voidrejoinPlayer(Player player, @Nullable Consumer<Optional<RejoinPlayerIssue>> callback) Tries to make the player rejoin the arena he previously was playing in.default voidSends the player to the hub.voidSends the player to the hub.voidsetCompanionOwner(Entity entity, @Nullable UUID owner) Set the owner of a companion.default voidsetCompanionOwner(Entity entity, @Nullable OfflinePlayer owner) Set the owner of a companion.voidsetScoreboardHandler(ScoreboardHandler handler) Set the new handler for scoreboards.booleanUnregisters the custom spawner handler.booleanUnregisters a previously registered handler forLobbyItems.booleanunregisterShopLayout(ShopLayout layout) Unregister an already existing ShopLayout using this method.booleanunregisterSpecialItem(SpecialItem specialItem) Tries to unregister an existing SpecialItem.booleanUnregisters a previously registered handler forSpectatorItems.booleanUnregister an already existing UpgradeShopLayout using this method.booleanTries to unregister an existing Upgrade.voiduseSpecialItem(SpecialItem item, Player player, Arena arena, ItemStack is) Simulates the player using the special item.
-
Method Details
-
createArena
ArenaBuilder createArena()Returns a builder to create and add an arena.Invoke
ArenaBuilder.finish()to add the arena.- Returns:
- The ArenaBuilder you can use to pass needed information to the arena
-
getArenas
Collection<Arena> getArenas()Returns all existing arenas.- Returns:
- Returns all added arenas
-
getArenaByName
Looks for an arena with that name and optionally parses it as an arena picker.- Parameters:
name- The name of the arena- Returns:
- The arena instance. Returns
nullif it hasn't found it
-
getArenaByExactName
Looks for an arena with exactly that name.Ignores display name, arena pickers etc.
- Parameters:
name- The name of the arena- Returns:
- The arena instance. Returns
nullif it hasn't found it
-
getArenaByPlayer
Looks for an arena with that player inside the arena.Ignores spectators and the state of the arena, meaning it doesn't care whether the arena is currently in lobby, running or in endlobby.
- Parameters:
player- The player who joined the arena- Returns:
- The arena instance. Returns
nullwhen the player isn't inside the arena
-
getArenaBySpectator
Looks for an arena with that player spectating the arena.Ignores normal players and the state of the arena, meaning it doesn't care whether the arena is currently in lobby, running or in endlobby.
- Parameters:
player- The player who's spectating the arena- Returns:
- The arena instance. Returns null when the player isn't spectating any arena
-
getArenaByLocation
Looks for all arenas where the location is inside the arena.There's most of the time and when the user has created the arenas correctly, only one entry in the collection.
Ignores lobby locations etc. and ignores non-normal types (RegenerationType.isNormal())- Parameters:
location- The location inside the arena- Returns:
- Returns the arena in which the location is inside. Returns null if there isn't any
-
isArenaNameValid
Returns weather or not the given String can be used as the name for an arenaDoes not check whether or not the arena already exists. It's only checking if the characters are valid.
- Parameters:
name- The name we want to check- Returns:
- If the given name is valid
-
getLobbyItems
Collection<? extends LobbyItem> getLobbyItems()Returns all existingLobbyItems.- Returns:
- All existing LobbyItems
- See Also:
-
getLobbyItems
Returns allLobbyItems that were added to a specific slot. Might benullif there's no item at the given slot.While it does not make any sense at the first glance keep in mind that LobbyItems are only visible at specific conditions. If you want to know which one is currently visible you might want to use
getVisibleLobbyItem(int, Player, Arena).- Parameters:
slot- The slot at which it's located at (0-8)- Returns:
- All items that were added to that slot,
nullif there's none - Throws:
IndexOutOfBoundsException- When slot is less than 0 or greater than 8- See Also:
-
getVisibleLobbyItem
Returns the currently visible item at a specific slot. Might benullif there's none.- Parameters:
slot- The slot at which it's located at (0-8)player- The player who'd see the itemarena- The arena in which the player is located in- Returns:
- The item that's visible for the player,
nullif there's none - See Also:
-
getLobbyItemHandlers
Collection<LobbyItemHandler> getLobbyItemHandlers()Returns all registered handlers. Also includes the default ones.They are being used for
LobbyItems (items that are being placed in the hotbar).- Returns:
- All registered item handlers
-
getLobbyItemHandler
Returns a registered item handler whos id is equal to the passed one. When there's none the method returnnull.- Parameters:
id- The id that shall match- Returns:
- The handler whos id is equal.
nullwhen there's none
-
registerLobbyItemHandler
Registers a handler forLobbyItems.The items are will automatically use it if their set handler id is equal to the given one, so it's not needed to use
LobbyItem.setHandler(LobbyItemHandler).Might fail (returns
false) if the id is already taken- Parameters:
handler- The handler that shall be registered- Returns:
trueif it was successful- Throws:
IllegalStateException- when there's something wrong with the properties of the handler
-
unregisterLobbyItemHandler
Unregisters a previously registered handler forLobbyItems.Might fail when it's not registered.
- Parameters:
handler- The handler that shall be unregistered- Returns:
truewhen it was successful
-
forceLobbyHotbarRefresh
Forcefully refresh the hotbar of a player during lobby phase.This may be useful if e.g. the icon changes. Note that there is no need to call this to update visibilities, as these get checked frequently. Refreshes only occur periodically and not immediately. May fail if the player isn't in a lobby.
- Parameters:
player- The player for whom we want to do the refresh- Returns:
trueif the player has been enqueued for a refresh
-
getDropTypes
Collection<DropType> getDropTypes()Returns all currently existing drop type.- Returns:
- All currently existing drop types
-
getDropTypeByDrop
Tries to find a DropType who could've dropped the itemis- Parameters:
is- The item that could've been dropped by a spawner- Returns:
- The DropType that fits to the
is.nullwhen there's none
-
getDropTypeById
Tries to find a DropType given by its id.- Parameters:
id- The id of the drop type- Returns:
- The DropType that fits to the
id.nullwhen there's none
-
registerCustomSpawnerHandler
Registers the custom spawner handler. Spawners will automatically adapt to it.- Parameters:
handler- The spawner handler- Returns:
falseif it failed because there's already a handler with the same id. Otherwisetrue- Throws:
IllegalStateException- When there's something wrong with the properties of the handler
-
unregisterCustomSpawnerHandler
Unregisters the custom spawner handler. Spawners will automatically detach from it.- Parameters:
handler- The spawner handler- Returns:
trueif its existence has been proved
-
getCustomSpawnerHandlers
Collection<CustomDropTypeHandler> getCustomSpawnerHandlers()Returns all registered custom spawner handlers.- Returns:
- All currently registered custom spawner handlers
-
getSpectatingPlayers
Collection<Player> getSpectatingPlayers()Returns all players who are currently spectating.- Returns:
- Every spectating player
-
getSpectators
Collection<Spectator> getSpectators()Returns the spectator data of every player who is currently spectating.- Returns:
- Spectator instances of any player who's currently spectating
-
isSpectator
Get whether the player is currently spectating.- Parameters:
player- The player who might be spectating- Returns:
trueif the player is currently spectating
-
getSpectatorByPlayer
Tries to find the corresponding Spectator instance given by its player. May returnnullwhen the player isn't actually spectating anything.- Parameters:
player- The player who might be spectating- Returns:
- His Spectator instance
-
getSpectatorItem
Returns a hotbar slot given by its slot. Might benullif there's no item at the given slot.- Parameters:
slot- The slot at which it's located at (0-8)- Returns:
- The item located at the slot,
nullif there's none - Throws:
IndexOutOfBoundsException- When slot is less than 0 or greater than 8
-
getSpectatorItemHandlers
Collection<SpectatorItemHandler> getSpectatorItemHandlers()Returns all registered handlers. Also includes the default ones.They are being used for
SpectatorItems (items that are being placed in the hotbar).- Returns:
- All registered item handlers
-
getSpectatorItemHandler
Returns a registered item handler whos id is equal to the passed one. When there's none the method returnnull.- Parameters:
id- The id that shall match- Returns:
- The handler whos id is equal.
nullwhen there's none
-
registerSpectatorItemHandler
Registers a handler forSpectatorItems.The items are will automatically use it if their set handler id is equal to the given one, so it's not needed to use
SpectatorItem.setHandler(SpectatorItemHandler).Might fail (returns
false) if the id is already taken- Parameters:
handler- The handler that shall be registered- Returns:
trueif it was successful- Throws:
IllegalStateException- when there's something wrong with the properties of the handler
-
unregisterSpectatorItemHandler
Unregisters a previously registered handler forSpectatorItems.Might fail when it's not registered.
- Parameters:
handler- The handler that shall be unregistered- Returns:
truewhen it was successful
-
getShopPages
Collection<ShopPage> getShopPages()Returns all existing pages inside the shop- Returns:
- All ShopPages
-
getShopItems
Collection<ShopItem> getShopItems()Returns all existing items inside the shop- Returns:
- All ShopItems
- See Also:
-
getShopItemById
Tries to locate and return aShopItemby its id.- Parameters:
id- The id of the item that matches withShopItem.getId(),- Returns:
- The item whose id is equal.
nullif there's none
-
getBuyGroups
Collection<BuyGroup> getBuyGroups()Returns all existing buy groups- Returns:
- All BuyGroups
-
getBuyGroup
Tries to locate and return aBuyGroupby its name- Parameters:
name- The name of the BuyGroup- Returns:
- The BuyGroup whose name is equal.
nullif there's none
-
getShopLayouts
Collection<ShopLayout> getShopLayouts()Returns all existing layouts for the shop- Returns:
- All existing ShopLayouts
-
getShopLayout
Tries to look up for a registered layout that has the given name.- Parameters:
layoutName- The name of the layout- Returns:
nullif none has been found or the layout that has been found
-
registerShopLayout
Create and register your own custom ShopLayout using this method. Have a class that inherits fromShopLayoutand pass it to this method. Users are able to use it by setting the name of your custom layout in their shop config.- Parameters:
layout- The new shop config- Returns:
- Returns
falseif there's already a layout under the given name. Otherwisetrue
-
unregisterShopLayout
Unregister an already existing ShopLayout using this method. It's not possible to unregister default types.- Parameters:
layout- The layout that shall be removed- Returns:
- Returns
tureif it got successfully removed
-
getDefaultShopLayout
ShopLayout getDefaultShopLayout()Returns the defaultShopLayoutthat's being used whenever the player clicks on the dealer- Returns:
- The default ShopLayout
-
getUpgradeShopLayouts
Collection<UpgradeShopLayout> getUpgradeShopLayouts()Returns all existing layouts for the upgrade shop- Returns:
- All existing UpgradeShopLayouts
-
getUpgradeShopLayout
Tries to look up for a registered layout that has the given name.- Parameters:
layoutName- The name of the layout- Returns:
nullif none has been found or the layout that has been found
-
registerUpgradeShopLayout
Create and register your own custom UpgradeShopLayout using this method. Have a class that inherits fromUpgradeShopLayoutand pass it to this method. Users are able to use it by setting the name of your custom layout in their upgrade shop config.- Parameters:
layout- The new upgrade shop config- Returns:
- Returns
falseif there's already a layout under the given name. Otherwisetrue
-
unregisterUpgradeShopLayout
Unregister an already existing UpgradeShopLayout using this method. It's not possible to unregister default types.- Parameters:
layout- The layout that shall be removed- Returns:
- Returns
tureif it got successfully removed
-
getDefaultUpgradeShopLayout
UpgradeShopLayout getDefaultUpgradeShopLayout()Returns the defaultUpgradeShopLayoutthat's being used whenever the player clicks on the upgrade dealer- Returns:
- The default ShopLayout
-
openAchievementsGUI
Opens the AchievementsGUI for a playerThe player doesn't have to be in an arena
- Parameters:
player- The player for whom the AchievementsGUI shall open
-
openShop
void openShop(Player player, ShopLayout layout, ShopOpenCause cause, @Nullable @Nullable ShopPage shopPage) Opens the shop for a player.The player doesn't have to be in an arena for debug purposes. It's not recommended to misuse this as it's likely that errors will occur.
- Parameters:
player- The player for whom the shop shall openlayout- The layout that shall be shown to the playercause- The cause for this event. Recommended to useShopOpenCause.PLUGINshopPage- The page the shop will open on (If null, the default first page will be used)
-
openShop
Opens the shop for a player.The player doesn't have to be in an arena for debug purposes. It's not recommended to misuse this as it's likely that errors will occur.
- Parameters:
player- The player for whom the shop shall openlayout- The layout that shall be shown to the playercause- The cause for this event. Recommended to useShopOpenCause.PLUGIN
-
openShop
Opens the shop for a player.The player doesn't have to be in an arena for debug purposes. It's not recommended to misuse this as it's likely that errors will occur.
- Parameters:
player- The player for whom the shop shall openlayout- The layout that shall be shown to the player
-
openShop
Opens the shop for a player.The player doesn't have to be in an arena for debug purposes. It's not recommended to misuse this as it's likely that errors will occur.
- Parameters:
player- The player for whom the shop shall opencause- The cause for this event. Recommended to useShopOpenCause.PLUGIN
-
openShop
Opens the shop for a player.The player doesn't have to be in an arena for debug purposes. It's not recommended to misuse this as it's likely that errors will occur.
- Parameters:
player- The player for whom the shop shall open
-
openUpgradeShop
Opens the upgrade shop for a player.The upgrade shop will fail to open if the player is not inside an arena, or the arena is not running, or if the player does not have a team
- Parameters:
player- The player for whom the upgrade shop shall open- Returns:
- whether or not the upgrade shop could be opened successfully
-
openUpgradeShop
Opens the upgrade shop for a player.The upgrade shop will fail to open if the arena is not running
- Parameters:
player- The player for whom the upgrade shop shall openarena- What arena the upgrade shop is being open forteam- The team the player is trying to buy an upgrade forcause- Why the upgrade shop is being opened- Returns:
- whether or not the upgrade shop could be opened successfully
-
getSpecialItems
Collection<SpecialItem> getSpecialItems()Returns all registered (including the default ones) SpecialItems.It's not safe to modify the resulting Collection. You may want to use
registerSpecialItem(String, Plugin, String, ItemStack)orunregisterSpecialItem(SpecialItem)instead- Returns:
- All existing
SpecialItems
-
getSpecialItem
Tries to locate and return aSpecialItemgiven by its id.- Parameters:
id- The id that shall match to the one of the item- Returns:
- The item whose id is equal.
nullwhen there's none
-
getSpecialItem
Tries to locate and return aSpecialItemgiven by its usable item.- Parameters:
itemStack- The item that we want to check- Returns:
- The
SpecialItemthat'll be executed on use
-
registerSpecialItem
@Nullable @Nullable SpecialItem registerSpecialItem(String id, Plugin plugin, String name, ItemStack item) Registers a customSpecialItemfor the later ingame use.Might fail when the id is already taken.
- Parameters:
id- The id that the item shall receiveplugin- The plugin that's creating the SpecialItemname- The name of the SpecialItem (that also will be displayed ingame, supports message codes)item- The ItemStack which players will use to execute the item- Returns:
- The newly initiated
SpecialIteminstance.nullwhen it failed because the id is already taken - Throws:
IllegalStateException- when there's something wrong with the properties of the handler
-
registerSpecialItem
Reregisters a SpecialItem that previously has been unregistered.Might fail when it's already registered or the id is already taken.
- Parameters:
specialItem- The item that shall be reregistered- Returns:
trueif it was successful- Throws:
IllegalStateException- when there's something wrong with the properties of the handler
-
unregisterSpecialItem
Tries to unregister an existing SpecialItem. This causes the item not to be useable and configurable anymore.- Parameters:
specialItem- The item that shall get removed- Returns:
falsewhen the SpecialItem already has been unregistered
-
useSpecialItem
Simulates the player using the special item.May fail if it has been cancelled using
Cancellable.setCancelled(boolean).- Parameters:
item- The item that's being usedplayer- The player that uses the itemarena- The arena in which the player is using the itemis- The item that's being used (the one that he is holding in his hand)- Throws:
IllegalStateException- If the item isn't registered
-
getUpgradeTriggerHandlers
Collection<UpgradeTriggerHandler> getUpgradeTriggerHandlers()Returns all registered (including the default ones) UpgradeTriggerHandlers.It's not safe to modify the resulting Collection. You may want to use
registerUpgradeTriggerHandler(UpgradeTriggerHandler)- Returns:
- All existing
UpgradeTriggerHandlers
-
getUpgradeTriggerHandler
Tries to locate and return aUpgradeTriggerHandlergiven by its id.- Parameters:
id- The id that shall match to the one of the handler- Returns:
- The handler whose id is equal.
nullwhen there's none
-
getUpgrades
Collection<Upgrade> getUpgrades()Returns all the upgrades that are currently loaded.- Returns:
- all loaded upgrades
-
registerUpgradeTriggerHandler
Registers a customUpgradeTriggerHandlerfor use in the upgradeshop.Might fail when the handlers id is already taken.
- Parameters:
handler- the handler that is being registered- Returns:
- The newly initiated
SpecialIteminstance.nullwhen it failed because the id is already taken
-
unregisterUpgradeTriggerHandler
Tries to unregister an existing Upgrade. This causes the item not to be useable and configurable anymore.- Parameters:
handler- item that shall get removed- Returns:
falsewhen the Upgrade already has been unregistered
-
isPlayerBlockMarkingSupported
boolean isPlayerBlockMarkingSupported()Plugin might mark blocks as player placed depending on their configuration. This allows to e.g. make players only to be able to break blocks they've placed during the match.This method
Arena.setBlockPlayerPlaced(org.bukkit.block.Block, boolean)andArena.isBlockPlayerPlaced(org.bukkit.block.Block)to check whether or not this is even possible.- Returns:
trueif the plugin supports player marking.falseif it has been disabled by the user
-
getDefaultScoreboardHandler
ScoreboardHandler getDefaultScoreboardHandler()Returns the default handler for scoreboards that's being provided by the plugin.
It's not a must that this handler is actually being used. It's possible that an other plugin might overwrite it usingsetScoreboardHandler(ScoreboardHandler). UsegetScoreboardHandler()to obtain the currently used handler.- Returns:
- The default handler for scoreboards
-
getScoreboardHandler
ScoreboardHandler getScoreboardHandler()Returns the current handler for scoreboards.It's possible for plugins to set a new handler using
setScoreboardHandler(ScoreboardHandler).- Returns:
- The currently used handler for scoreboards
-
setScoreboardHandler
Set the new handler for scoreboards.The plugin will automatically replace it with the default one when the plugin unloads. Additionally it'll automatically add the existing players from the previous one to the new one.
Use
getDefaultScoreboardHandler()to change it back to default.- Parameters:
handler- The new handler for scoreboards
-
rejoinPlayer
void rejoinPlayer(Player player, @Nullable @Nullable Consumer<Optional<RejoinPlayerIssue>> callback) Tries to make the player rejoin the arena he previously was playing in.The task is being processed async, hence the callback.
- Parameters:
player- The player who shall rejoin a matchcallback- The result of all of this
-
sendToHub
Sends the player to the hub.Where exactly the player is being teleported to depends on the configuration of the server. It could include one of these options:
- To the hub-position that has been specified using /bw sethubpos
- Being kicked out of the server
- Being sent to the hub server
- Parameters:
player- The player that shall be moved- See Also:
-
sendToHub
Sends the player to the hub.Where exactly the player is being teleported to depends on the configuration of the server. It could include one of these options:
- To the hub-position that has been specified using /bw sethubpos
- Being kicked out of the server (only whenpermitKickingis set to true)
- Being sent to the hub server (only whenpermitKickingis set to true)
- Parameters:
player- The player that shall be movedpermitKicking- Whether the player may only get teleported on the same server. When set tofalse, the player may never leave the server- See Also:
-
getCompanionOwner
Get the UUID of the player who owns the given companion.A companion may e.g. be an iron golem, a guard dog, a fireball etc.
- Parameters:
entity- The companion- Returns:
- The UUID of the player
Entity.getUniqueId()who spawned the companion. May benullfor none - Throws:
IllegalArgumentException- Ifentityis an invalid entity type (e.g. if it's a player)- See Also:
-
setCompanionOwner
Set the owner of a companion.A companion may e.g. be an iron golem, a guard dog, a fireball etc.
- Parameters:
entity- The companionowner- The UUID of the playerEntity.getUniqueId()who spawned the companion. May benullfor none- Throws:
IllegalArgumentException- Ifentityis an invalid entity type (e.g. if it's a player)- See Also:
-
setCompanionOwner
Set the owner of a companion.A companion may e.g. be an iron golem, a guard dog, a fireball etc.
- Parameters:
entity- The companionowner- The player who spawned the companion. May benullfor none- Throws:
IllegalArgumentException- Ifentityis an invalid entity type (e.g. if it's a player)- See Also:
-
getCloningManager
ArenaCloningManager getCloningManager()Returns theArenaCloningManagerwhose purpose it is to automatically clone new arenas.- Returns:
- The global ArenaCloningManager instance
-
drawBorder
Draw a cube border once.This method uses the exact same logic as for the region arena border. It may be expensive to process, thus it's recommended to call it async.
- Parameters:
min- Coordinates that are less than themaxparametermax- Coordinates that are greater than theminparameterplayer- For whom the border shall be drawn for
-
getLastPlayerCausedDamage
Get the info of the last directly/indirectly player-caused damage during a match.This info is used to obtain the killer when the damaged player dies.
- Parameters:
damaged- The player who got damaged- Returns:
- The related info object. May be
nullif nobody damaged him yet
-
getLastTeleporterSpecialItemUse
Get the last time the player had used theSpecialItemType.TELEPORTERspecial item.May not be known if the player hasn't used it before, or the info had been cleared internally after successful teleportation. It's only used for its cooldown feature.
- Parameters:
player- The player who used the special item- Returns:
- The time when the player used the special item. May be
null
-
get
Returns the global GameAPI instance.- Returns:
- The global GameAPI instance
-