Crates.io | azalea-protocol |
lib.rs | azalea-protocol |
version | 0.10.2 |
source | src |
created_at | 2022-09-05 15:35:52.603699 |
updated_at | 2024-06-14 00:44:39.87171 |
description | Send and receive Minecraft packets. |
homepage | |
repository | https://github.com/azalea-rs/azalea/tree/main/azalea-protocol |
max_upload_size | |
id | 658911 |
size | 364,180 |
A low-level crate to send and receive Minecraft packets. You should probably use azalea
or azalea-client
instead.
The goal is to only support the latest Minecraft version in order to ease development.
This is not yet complete, search for TODO
in the code for things that need to be done.
Unfortunately, using azalea-protocol requires Rust nightly because specialization is not stable yet. Use rustup default nightly
to enable it.
Adding new packets is usually pretty easy, but you'll want to have Minecraft's decompiled source code which you can obtain with tools such as DecompilerMC.
python codegen/newpacket.py [packet id] [clientbound or serverbound] \[game/handshake/login/status\]
\net/minecraft/network/protocol/<state>
directory. The state for your packet is usually game
.You can manually implement reading and writing functionality for a packet by implementing McBufReadable and McBufWritable, but you can also have this automatically generated for a struct or enum by deriving McBuf.
Look at other packets as an example.