API interface for interacting with EssentialsC's Random Teleport (RTP) system. Allows external plugins to query RTP state, trigger teleports, and inspect per-world configuration without direct dependency on internal classes.
Retrieve an instance via EssentialsCAPI.getRtpApi().
RtpApi rtp = APIProvider.getAPI().getRtpApi();
if (!rtp.isOnCooldown(player)) {
World world = Bukkit.getWorld("world");
rtp.startRTP(player, world);
}
All methods are synchronous and safe to call on the main thread. The
startRTP method must be called on the main thread.
Method Summary
| boolean |
isEnabled() Returns whether the RTP system is enabled globally in config. |
| boolean |
isWorldEnabled(String worldName) Returns whether RTP is enabled for the given world name. |
| boolean |
isOnCooldown(Player player) Returns whether the given player is currently on RTP cooldown. |
| long |
getRemainingCooldown(Player player) Returns the remaining cooldown time in seconds for the given player. |
| boolean |
isRtpInProgress(Player player) Returns whether a random teleport is currently in progress for the player. |
| boolean |
hasWorldPermission(Player player, String worldName) Returns whether the given player has permission to use RTP in the specified world. |
| List<String> |
getConfiguredWorldNames() Returns the list of world names that are configured for RTP and currently loaded. |
| int |
getPlayerCountInWorld(String worldName) Returns the number of players currently in the given world. |
| void |
startRTP(Player player, World world) Initiates a random teleport for the given player in the specified world. |
Returns whether the RTP system is enabled globally in config.
Returns:| boolean | true if RTP is enabled |
Returns whether RTP is enabled for the given world name.
Parameters:| worldName | the world to check; must not be null |
| boolean | true if RTP is enabled for that world |
Returns whether the given player is currently on RTP cooldown.
Players with the essentialsc.rtp.bypass.cooldown permission are never considered on cooldown.
| player | the player to check; must not be null |
| boolean | true if the player must wait before using RTP again |
Returns the remaining cooldown time in seconds for the given player.
Returns 0 if the player is not on cooldown or has bypass permission.
| player | the player to check; must not be null |
| long | remaining cooldown in seconds, or 0 |
Returns whether a random teleport is currently in progress for the given player (i.e. they are in warmup or location-search phase).
Parameters:| player | the player to check; must not be null |
| boolean | true if an RTP is already running for this player |
Returns whether the given player has permission to use RTP in the specified world.
Parameters:| player | the player to check; must not be null |
| worldName | the world name; must not be null |
| boolean | true if the player has the required world permission |
Returns the list of world names that are configured for RTP and currently loaded.
Returns:| List<String> | an unmodifiable sorted list of world names; never null |
Returns the number of players currently in the given world.
Parameters:| worldName | the world to query; must not be null |
| int | the player count, or 0 if the world is not loaded |
Initiates a random teleport for the given player in the specified world.
Performs all standard checks (permission, cooldown, world enabled, in-progress) and sends the appropriate lang messages. Warmup is applied unless the player has bypass permission.
| player | the online player to teleport; must not be null |
| world | the world to teleport into; must not be null |