MeexReay 9f7c6fce69
All checks were successful
Rust / Check (push) Successful in 9m54s
Rust / Build (push) Successful in 12m1s
Rust / Test Suite (push) Successful in 12m1s
remove cargo features
2025-05-07 18:28:15 +03:00
2025-05-01 15:11:15 +03:00
2025-05-01 13:31:56 +03:00
2025-05-01 15:28:58 +03:00
2025-04-28 11:05:52 +03:00
2025-05-07 18:28:15 +03:00
2025-04-28 11:05:52 +03:00
2025-05-01 15:30:27 +03:00

rust_mc_proto

Lightweight minecraft packets protocol support in pure rust
Has compression (MinecraftConnection::set_compression)
This crate can be used for a server on rust idk -_-

Setup

rust_mc_proto = "0.1.19" # stable version
rust_mc_proto = { git = "https://git.meex.lol/MeexReay/rust_mc_proto" } # unstable version

How to use

Example 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
}

More examples
Documentation

Contributing

If you would like to contribute to the project, feel free to fork the repository and submit a pull request.

License

This project is licensed under the WTFPL License

Description
Lightweight Minecraft protocol implementation in pure rust
Readme 182 KiB
Languages
Rust 100%