A Kotlin-based Minecraft request library provides utility functions related to Minecraft queries.
dependencies {
implementation("tech.aliorpse:mcutils:$version")
}
runBlocking {
var status
status = JavaServer.getStatus("mc.hypixel.net")
// More options
status = JavaServer.getStatus(
host = "wdsj.net",
port = 25565,
enableSrv = true
)
// Bedrock servers
status = BedrockServer.getStatus("play.easecation.net")
println(status)
}
runBlocking {
var pl
pl = Player.getProfile("Aliorpse")
pl = Player.getProfile("ec042e1200ac4a249cc83eb1fab0bd88")
pl = Player.getProfile("ec042e12-00ac-4a24-9cc8-3eb1fab0bd88")
println(pl)
}
All suspend functions also provide a CompletableFuture
variant,
allowing you to call them directly from Java without dealing with coroutines.
CompletableFuture<JavaServerStatus> status = JavaServer.getStatusAsync("mc.hypixel.net");