Crate mcrcon

Source
Expand description

mcrcon is a client-side implementation of the RCON protocol for Minecraft servers, as described here. It allows you to write Rust code which can remotely execute commands on Minecraft servers.

§Example

use mcrcon;
 
fn main() -> Result<(), mcrcon::RCONError> {
    let mut stream = std::net::TcpStream::new("localhost:25575")?;
    let mut connection = mcrcon::Connection::connect(stream, "password".to_string())?;
    let resp = connection.command("seed".to_string())?;
 
    println!("{}", resp.payload);
}

Structs§

Connection
A connection to a Minecraft server.
Packet
A packet received from the server.

Enums§

RCONError
An RCON error.