Skip to content

SmartBR/minecraft-server-info

Repository files navigation

minecraft-server-info

API to obtain information from a minecraft server.

How to install (Gradle)

repositories {
    mavenCentral()

    maven {
        url = 'https://jitpack.io'
    }
}

dependencies  {
    compile 'com.github.SmartBR:minecraft-server-info:-SNAPSHOT'
}

How to install (Maven)

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.SmartBR</groupId>
    <artifactId>minecraft-server-info</artifactId>
    <version>-SNAPSHOT</version>
</dependency>

Examples

class Test {

    public static void main(String[] args) {
        MCServerInfo mcserver = new MCServerInfo();

        mcserver.getServer("mc.hypixel.net").whenComplete((serverResponse, throwable) -> {
            if (throwable != null) {
                throwable.printStackTrace();
                return;
            }

            System.out.println(serverResponse.toString());
        });
    }
}

Json Information:

{
  "online": true,
  "ip": "127.0.0.1",
  "port": 25565,
  "hostname": "dc-server",
  "version": "1.7x-1.16x",
  "onlinePlayers": 150000,
  "maxPlayers": 200000
}

About

API to obtain information from a minecraft server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages