Skip to content

A Kotlin-based request library provides utility functions related to Minecraft, such as server ping and player query.

License

Notifications You must be signed in to change notification settings

Aliorpse/kotlin-mcutils

Repository files navigation

mcutils

Codacy Badge CodeFactor Maven Central

A Kotlin-based Minecraft request library provides utility functions related to Minecraft queries.

Installation

dependencies {
    implementation("tech.aliorpse:mcutils:$version")
}

Features

Server Status

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)
}

Player Profile (Java Edition Only)

runBlocking {
    var pl
    pl = Player.getProfile("Aliorpse")
    pl = Player.getProfile("ec042e1200ac4a249cc83eb1fab0bd88")
    pl = Player.getProfile("ec042e12-00ac-4a24-9cc8-3eb1fab0bd88")

    println(pl)
}

Java Usage

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

About

A Kotlin-based request library provides utility functions related to Minecraft, such as server ping and player query.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages