Quick Start
Basic Usage
Create an RconClient and send a command:
import io.cavarest.rcon.RconClient;
import io.cavarest.rcon.RconResponse;
public class Example {
public static void main(String[] args) {
// Create the client
RconClient client = RconClient.builder()
.host("localhost")
.port(25575)
.password("your_password")
.build();
// Send a command
RconResponse response = client.sendCommand("list");
// Print the response
System.out.println("Response: " + response.getResponse());
// Close when done
client.close();
}
}Expected Output
Response: There are 5 out of max 20 players online:
Player1, Player2, Player3, Player4, Player5What’s Happening?
-
Client Creation - The
RconClient.Builderconfigures connection parameters -
Authentication - The client automatically authenticates on first use
-
Command Execution - The command is sent and response is received
-
Multi-Packet Handling - Large responses are automatically assembled (you don’t need to do anything!)
Next Steps
-
Architecture Overview - Understand the layers
-
Basic Usage Guide - Learn common patterns
-
API Reference - Explore the full API