| Crates.io | rust_mc_proto |
| lib.rs | rust_mc_proto |
| version | 0.1.19 |
| created_at | 2024-05-11 21:17:47.703057+00 |
| updated_at | 2025-05-01 12:29:17.038059+00 |
| description | lightweight minecraft protocol support in pure rust |
| homepage | |
| repository | https://git.meex.lol/MeexReay/rust_mc_proto |
| max_upload_size | |
| id | 1237060 |
| size | 54,149 |
Lightweight minecraft packets protocol support in pure rust
Has compression (MinecraftConnection::set_compression)
This crate can be used for a server on rust idk -_-
rust_mc_proto = "0.1.19" # stable version
rust_mc_proto = { git = "https://git.meex.lol/MeexReay/rust_mc_proto" } # unstable version
Features:
atomic_clone - Atomic clone of MinecraftConnectionExample of receiving motd:
use rust_mc_proto::{DataReader, DataWriter, MCConnTcp, Packet, ProtocolError};
fn main() -> Result<(), ProtocolError> {
let mut conn = MCConnTcp::connect("localhost:25565")?; // connecting
conn.write_packet(&Packet::build(0x00, |packet| {
packet.write_varint(765)?; // protocol_version
packet.write_string("localhost")?; // server_address
packet.write_unsigned_short(25565)?; // server_port
packet.write_varint(1) // next_state
})?)?; // handshake packet
conn.write_packet(&Packet::empty(0x00))?; // status request packet
Ok(println!("motd: {}", conn.read_packet()?.read_string()?)) // status response packet
}
If you would like to contribute to the project, feel free to fork the repository and submit a pull request.
This project is licensed under the WTFPL License