An open API service indexing awesome lists of open source software.

https://github.com/pequla/serverping

Very simple and fast Minecraft server status library using the Server List Ping protocol
https://github.com/pequla/serverping

gson java-11 java11 minecraft minecraft-library minecraft-ping

Last synced: 6 months ago
JSON representation

Very simple and fast Minecraft server status library using the Server List Ping protocol

Awesome Lists containing this project

README

          

# ServerPing

Are you looking for a simple-to-use Minecraft Server List Ping library with a permissive licence? Look no further, you
just found it.

### Usage

If you are using Maven just add the following to your `pom.xml`

```xml


pequla-repo
https://maven.pequla.com/releases


com.pequla
server-ping
1.2


com.google.code.gson
gson
2.10.1

```

### Example

```java
public class ServerPingExample {
public static void main(String[] args) throws IOException {
InetAddress address = InetAddress.getByName("play.beocraft.net");
int port = 25565;
ServerPing ping = new ServerPing(new InetSocketAddress(address, port));
StatusResponse response = ping.fetchData();
System.out.println(response.getPlayers().getOnline());
}
}
```