Skip to content

BungeeCord

Gabriel Souza edited this page Aug 8, 2020 · 3 revisions

KotlinBukkitAPI provides an easy way to send and receive responses from BungeeCord Messages with the power of Coroutines and suspend functions.

Provided functions by the KotlinBukkitAPI:

// sends the player to a Server
fun sendToServer(server: String)
// returns the IP of the Player (Address and Port)
suspend fun retrieveIp(): Pair<String, Int>
// returns the amout of players online in a server or "ALL" to all servers
suspend fun onlinePlayerAt(server: String = "ALL"): Int
// returns the current server name in the BungeeCord
suspend fun retrieveServerName(): String
// Kicks a Player from the Proxy (BungeeCord)
fun kickPlayer(player: String, reason: String)

Usage

player.bungeecord.sendToServer("factions")

val playerIp = player.bungeecord.retrieveIp()

player.msg("Your current ip is: $playerIp")
Clone this wiki locally