BungeeCord extensions

For use this extensions you need to include thridparty module:

library("tech.carcadex:kotlinbukkitkit-thirdparty:1.0.0.3")

And register this module in onEnable():

initBungeeCordController()

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

Provided functions by the KotlinBukkitKIT :

// 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")

Warning

You need to activate bungeecord controller before using it:

initBungeeCordController()

In onEnable method of your plugin

Last updated