#minecraft #rcon

mcrcon

An impelementation of Minecraft's RCON protocol

1 unstable release

0.1.0 Sep 3, 2021

#17 in #rcon

Unlicense

13KB
179 lines

mcrcon

An implementation of Minecraft's RCON protocol written in Rust, allowing Rust code to easily remotely execute commands on a Minecraft server.


lib.rs:

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);
}

Dependencies

~315KB