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")
}
runBlocking {
var pl
pl = Player.getProfile("Aliorpse")
pl = Player.getProfile("ec042e1200ac4a249cc83eb1fab0bd88")
pl = Player.getProfile("ec042e12-00ac-4a24-9cc8-3eb1fab0bd88")
}
Modrinth API
runBlocking {
var result
result = Modrinth.search("xplus") {
author = "Wudji"
type = ProjectType.MODPACK
}
result = Modrinth.getProject("2H1rLgy4")
result = Modrinth.getProjects(listOf("2H1rLgy4"))
result = Modrinth.getProjectsRandom(5)
}
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");