Interface GameAPI
-
Method Summary
Modifier and TypeMethodDescriptionReturns a builder to create and add an arena.void
drawBorder
(XYZ min, XYZ max, Player player) Draw a cube border once.boolean
forceLobbyHotbarRefresh
(Player player) Forcefully refresh the hotbar of a player during lobby phase.static GameAPI
get()
Returns the global GameAPI instance.@Nullable Arena
getArenaByExactName
(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 Arena
getArenaByName
(String name) Looks for an arena with that name and optionally parses it as an arena picker.@Nullable Arena
getArenaByPlayer
(Player player) Looks for an arena with that player inside the arena.@Nullable Arena
getArenaBySpectator
(Player player) Looks for an arena with that player spectating the arena.Returns all existing arenas.@Nullable BuyGroup
getBuyGroup
(String name) Tries to locate and return aBuyGroup
by its nameReturns all existing buy groupsReturns theArenaCloningManager
whose purpose it is to automatically clone new arenas.@Nullable UUID
getCompanionOwner
(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 defaultShopLayout
that's being used whenever the player clicks on the dealerReturns the defaultUpgradeShopLayout
that's being used whenever the player clicks on the upgrade dealer@Nullable DropType
Tries to find a DropType who could've dropped the itemis
@Nullable DropType
Tries to find a DropType given by its id.Returns all currently existing drop type.@Nullable PlayerDamageInfo
getLastPlayerCausedDamage
(Player damaged) Get the info of the last directly/indirectly player-caused damage during a match.@Nullable LobbyItemHandler
Returns a registered item handler whos id is equal to the passed one.Returns all registered handlers.Collection
<? extends LobbyItem> Returns all existingLobbyItem
s.@Nullable Collection
<? extends LobbyItem> getLobbyItems
(int slot) Returns allLobbyItem
s that were added to a specific slot.Returns the current handler for scoreboards.@Nullable ShopLayout
getShopLayout
(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 SpecialItem
getSpecialItem
(String id) Tries to locate and return aSpecialItem
given by its id.@Nullable SpecialItem
getSpecialItem
(ItemStack itemStack) Tries to locate and return aSpecialItem
given by its usable item.Returns all registered (including the default ones) SpecialItems.Returns all players who are currently spectating.@Nullable Spectator
getSpectatorByPlayer
(Player player) Tries to find the corresponding Spectator instance given by its player.@Nullable SpectatorItem
getSpectatorItem
(int slot) Returns a hotbar slot given by its slot.@Nullable SpectatorItemHandler
Returns 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 UpgradeShopLayout
getUpgradeShopLayout
(String layoutName) Tries to look up for a registered layout that has the given name.Returns all existing layouts for the upgrade shop@Nullable UpgradeTriggerHandler
Tries to locate and return aUpgradeTriggerHandler
given by its id.Returns all registered (including the default ones) UpgradeTriggerHandlers.@Nullable LobbyItem
getVisibleLobbyItem
(int slot, Player player, Arena arena) Returns the currently visible item at a specific slot.boolean
isArenaNameValid
(String name) Returns weather or not the given String can be used as the name for an arenaboolean
Plugin might mark blocks as player placed depending on their configuration.void
openAchievementsGUI
(Player player) Opens the AchievementsGUI for a playerdefault void
Opens the shop for a player.default void
openShop
(Player player, ShopLayout layout) Opens the shop for a player.default void
openShop
(Player player, ShopLayout layout, ShopOpenCause cause) Opens the shop for a player.void
openShop
(Player player, ShopLayout layout, ShopOpenCause cause, @Nullable ShopPage shopPage) Opens the shop for a player.default void
openShop
(Player player, ShopOpenCause cause) Opens the shop for a player.boolean
openUpgradeShop
(Player player) Opens the upgrade shop for a player.boolean
openUpgradeShop
(Player player, Arena arena, Team team, UpgradeShopOpenCause cause) Opens the upgrade shop for a player.boolean
Registers the custom spawner handler.boolean
registerLobbyItemHandler
(LobbyItemHandler handler) Registers a handler forLobbyItem
s.boolean
registerShopLayout
(ShopLayout layout) Create and register your own custom ShopLayout using this method.boolean
registerSpecialItem
(SpecialItem specialItem) Reregisters a SpecialItem that previously has been unregistered.@Nullable SpecialItem
registerSpecialItem
(String id, Plugin plugin, String name, ItemStack item) Registers a customSpecialItem
for the later ingame use.boolean
Registers a handler forSpectatorItem
s.boolean
Create and register your own custom UpgradeShopLayout using this method.boolean
Registers a customUpgradeTriggerHandler
for use in the upgradeshop.void
rejoinPlayer
(Player player, @Nullable Consumer<Optional<RejoinPlayerIssue>> callback) Tries to make the player rejoin the arena he previously was playing in.default void
Sends the player to the hub.void
Sends the player to the hub.void
setCompanionOwner
(Entity entity, @Nullable UUID owner) Set the owner of a companion.default void
setCompanionOwner
(Entity entity, @Nullable OfflinePlayer owner) Set the owner of a companion.void
setScoreboardHandler
(ScoreboardHandler handler) Set the new handler for scoreboards.boolean
Unregisters the custom spawner handler.boolean
Unregisters a previously registered handler forLobbyItem
s.boolean
unregisterShopLayout
(ShopLayout layout) Unregister an already existing ShopLayout using this method.boolean
unregisterSpecialItem
(SpecialItem specialItem) Tries to unregister an existing SpecialItem.boolean
Unregisters a previously registered handler forSpectatorItem
s.boolean
Unregister an already existing UpgradeShopLayout using this method.boolean
Tries to unregister an existing Upgrade.void
useSpecialItem
(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
null
if 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
null
if 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
null
when 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 existingLobbyItem
s.- Returns:
- All existing LobbyItems
- See Also:
-
getLobbyItems
Returns allLobbyItem
s that were added to a specific slot. Might benull
if 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,
null
if 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 benull
if 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,
null
if there's none - See Also:
-
getLobbyItemHandlers
Collection<LobbyItemHandler> getLobbyItemHandlers()Returns all registered handlers. Also includes the default ones.They are being used for
LobbyItem
s (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.
null
when there's none
-
registerLobbyItemHandler
Registers a handler forLobbyItem
s.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:
true
if it was successful- Throws:
IllegalStateException
- when there's something wrong with the properties of the handler
-
unregisterLobbyItemHandler
Unregisters a previously registered handler forLobbyItem
s.Might fail when it's not registered.
- Parameters:
handler
- The handler that shall be unregistered- Returns:
true
when 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:
true
if 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
.null
when 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
.null
when there's none
-
registerCustomSpawnerHandler
Registers the custom spawner handler. Spawners will automatically adapt to it.- Parameters:
handler
- The spawner handler- Returns:
false
if 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:
true
if its existence has been proved
-
getCustomSpawnerHandlers
Collection<CustomSpawnerHandler> 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
-
getSpectatorByPlayer
Tries to find the corresponding Spectator instance given by its player. May returnnull
when 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 benull
if 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,
null
if 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
SpectatorItem
s (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.
null
when there's none
-
registerSpectatorItemHandler
Registers a handler forSpectatorItem
s.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:
true
if it was successful- Throws:
IllegalStateException
- when there's something wrong with the properties of the handler
-
unregisterSpectatorItemHandler
Unregisters a previously registered handler forSpectatorItem
s.Might fail when it's not registered.
- Parameters:
handler
- The handler that shall be unregistered- Returns:
true
when it was successful
-
getShopPages
Collection<ShopPage> getShopPages()Returns all existing pages inside the shop- Returns:
- All ShopPages
-
getBuyGroups
Collection<BuyGroup> getBuyGroups()Returns all existing buy groups- Returns:
- All BuyGroups
-
getBuyGroup
Tries to locate and return aBuyGroup
by its name- Parameters:
name
- The name of the BuyGroup- Returns:
- The BuyGroup whose name is equal.
null
if 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:
null
if 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 fromShopLayout
and 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
false
if 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
ture
if it got successfully removed
-
getDefaultShopLayout
ShopLayout getDefaultShopLayout()Returns the defaultShopLayout
that'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:
null
if 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 fromUpgradeShopLayout
and 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
false
if 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
ture
if it got successfully removed
-
getDefaultUpgradeShopLayout
UpgradeShopLayout getDefaultUpgradeShopLayout()Returns the defaultUpgradeShopLayout
that'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.PLUGIN
shopPage
- 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
SpecialItem
s
-
getSpecialItem
Tries to locate and return aSpecialItem
given by its id.- Parameters:
id
- The id that shall match to the one of the item- Returns:
- The item whose id is equal.
null
when there's none
-
getSpecialItem
Tries to locate and return aSpecialItem
given by its usable item.- Parameters:
itemStack
- The item that we want to check- Returns:
- The
SpecialItem
that'll be executed on use
-
registerSpecialItem
@Nullable @Nullable SpecialItem registerSpecialItem(String id, Plugin plugin, String name, ItemStack item) Registers a customSpecialItem
for 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
SpecialItem
instance.null
when 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:
true
if 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:
false
when 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
UpgradeTriggerHandler
s
-
getUpgradeTriggerHandler
Tries to locate and return aUpgradeTriggerHandler
given by its id.- Parameters:
id
- The id that shall match to the one of the handler- Returns:
- The handler whose id is equal.
null
when there's none
-
getUpgrades
Collection<Upgrade> getUpgrades()Returns all the upgrades that are currently loaded.- Returns:
- all loaded upgrades
-
registerUpgradeTriggerHandler
Registers a customUpgradeTriggerHandler
for 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
SpecialItem
instance.null
when 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:
false
when 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:
true
if the plugin supports player marking.false
if 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 whenpermitKicking
is set to true)
- Being sent to the hub server (only whenpermitKicking
is 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 benull
for none - Throws:
IllegalArgumentException
- Ifentity
is 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 benull
for none- Throws:
IllegalArgumentException
- Ifentity
is 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 benull
for none- Throws:
IllegalArgumentException
- Ifentity
is an invalid entity type (e.g. if it's a player)- See Also:
-
getCloningManager
ArenaCloningManager getCloningManager()Returns theArenaCloningManager
whose 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 themax
parametermax
- Coordinates that are greater than themin
parameterplayer
- 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
null
if nobody damaged him yet
-
get
Returns the global GameAPI instance.- Returns:
- The global GameAPI instance
-