-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathExample.java
More file actions
22 lines (21 loc) · 944 Bytes
/
Example.java
File metadata and controls
22 lines (21 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import me.dilley.MineStat;
class Example
{
public static void main(String[] args)
{
MineStat ms = new MineStat("minecraft.frag.land");
System.out.println("Minecraft server status of " + ms.getAddress() + " on port " + ms.getPort() + ":");
if(ms.isServerUp())
{
System.out.println("Server is online running version " + ms.getVersion() + " with " + ms.getCurrentPlayers() + " out of " + ms.getMaximumPlayers() + " players.");
if(ms.getRequestType().equals("Bedrock/Pocket Edition"))
System.out.println("Game mode: " + ms.getGameMode());
System.out.println("Message of the day: " + ms.getMotd());
System.out.println("Message of the day without formatting: " + ms.getStrippedMotd());
System.out.println("Latency: " + ms.getLatency() + "ms");
System.out.println("Connected using protocol: " + ms.getRequestType());
}
else
System.out.println("Server is offline!");
}
}