API interface for interacting with EssentialsC's TPA (teleport request) system. Manages teleport requests between players with cooldowns, warmup, economy costs, and safety checks (movement, damage). Supports both TPA and TPAHere request types.
Retrieve an instance via EssentialsCAPI.getTpaApi().
TpaApi tpa = APIProvider.getAPI().getTpaApi(); tpa.requestTeleport(requester, target, TPARequestEntry.Type.TPA);
The TPARequestEntry record lives in the
net.godlycow.org.essc.api.teleport sub-package.
Method Summary
| boolean |
requestTeleport(Player requester, Player target, TPARequestEntry.Type type) Sends a teleport request from one player to another. |
| boolean |
acceptRequest(Player target, Player requester) Accepts a pending teleport request from the requester to the target. |
| boolean |
denyRequest(Player target, Player requester) Denies a pending teleport request from the requester to the target. |
| boolean |
cancelRequest(Player requester, Player target) Cancels an outgoing teleport request from the requester to the target. |
| void |
toggleTPA(Player player) Toggles TPA requests on/off for the given player. |
| void |
toggleIgnore(Player player, Player target) Toggles ignore status for a specific player. |
| List<TPARequestEntry> |
getIncomingRequests(Player player) Returns all incoming TPA requests for the given player. |
| List<TPARequestEntry> |
getOutgoingRequests(Player player) Returns all outgoing TPA requests for the given player. |
| boolean |
hasIncomingRequests(Player player) Returns whether the player has any pending incoming requests. |
| boolean |
hasOutgoingRequests(Player player) Returns whether the player has any pending outgoing requests. |
| boolean |
isBlocking(Player player) Returns whether the player has TPA requests blocked. |
| void |
cancelTeleport(Player player, String reason) Cancels an active teleport warmup for the given player. |
| boolean |
isInTeleport(Player player) Returns whether the player is currently in teleport warmup. |
| void |
reload() Reloads the TPA configuration from disk. |
Sends a teleport request from one player to another. Validates cooldowns, blocked status, ignores, and economy funds. Sends appropriate messages to both players on success or failure.
| requester | the player sending the request; must not be null |
| target | the player receiving the request; must not be null |
| type | the type of request (TPA or TPAHERE); must not be null |
| boolean | true if the request was sent successfully |
Accepts a pending teleport request from the requester to the target. Initiates the teleport warmup and deducts economy cost if configured.
| target | the player accepting the request; must not be null |
| requester | the player who sent the request; must not be null |
| boolean | true if a valid request was found and accepted |
Denies a pending teleport request from the requester to the target. Notifies both players of the denial.
| target | the player denying the request; must not be null |
| requester | the player who sent the request; must not be null |
| boolean | true if a valid request was found and denied |
Cancels an outgoing teleport request from the requester to the target. Notifies the requester of the cancellation.
| requester | the player cancelling their request; must not be null |
| target | the target player of the request; must not be null |
| boolean | true if a valid outgoing request was found and cancelled |
Toggles TPA requests on/off for the given player. When disabled, other players cannot send TPA requests to this player.
| player | the player to toggle; must not be null |
Toggles ignore status for a specific player. When ignoring a player, their TPA requests will be silently rejected.
| player | the player toggling ignore; must not be null |
| target | the player to ignore/unignore; must not be null |
Returns all incoming TPA requests for the given player. Automatically cleans up expired requests before returning.
Parameters:| player | the player to check; must not be null |
| List<TPARequestEntry> | an unmodifiable list of incoming requests; never null |
Returns all outgoing TPA requests for the given player. Automatically cleans up expired requests before returning.
Parameters:| player | the player to check; must not be null |
| List<TPARequestEntry> | an unmodifiable list of outgoing requests; never null |
Returns whether the player has any pending incoming requests.
Parameters:| player | the player to check; must not be null |
| boolean | true if there are pending incoming requests |
Returns whether the player has any pending outgoing requests.
Parameters:| player | the player to check; must not be null |
| boolean | true if there are pending outgoing requests |
Returns whether the player has TPA requests blocked.
Parameters:| player | the player to check; must not be null |
| boolean | true if the player is blocking TPA requests |
Cancels an active teleport warmup for the given player. Called automatically on movement, damage, or disconnect.
| player | the player whose teleport to cancel; must not be null |
| reason | the cancellation reason key (e.g., "move", "damage") |
Returns whether the player is currently in teleport warmup.
Parameters:| player | the player to check; must not be null |
| boolean | true if a teleport is in progress |
Reloads the TPA configuration from disk. Re-reads cooldown, warmup, timeout, and cost settings from config.