enum State(i32) { Handshake Status Login Play } enum NextState(VarInt) { Status = 1 Login } enum Mouse(i8) { LeftClick RightClick } enum Status(i8) { StartDigging CancelDigging FinishDigging DropItemStack DropItem ShootArrowOrFinishEating } enum Face(i8) { Down Up North South West East } enum Animation(i8) { None SwingArm TakeDamage LeaveBed EatFood CriticalEffect MagicCriticalEffect Unknown = 102 Crouch = 104 Uncrouch } enum EntityAction(i8) { Crouch = 1 Uncrouch LeaveBed StartSprinting StopSprinting } type Slot { i16 id if (id != -1) { i8 count i16 damage i16 data_length if (data_length != -1) { Nbt data } } } // Handshake packet Handshake(serverbound, Handshake, 0x00) { VarInt protocol_version = PVN String server_address u16 server_port NextState next_state } // Status packet Request(serverbound, Status, 0x00) {} packet Ping(serverbound, Status, 0x01) { i64 time } // Login packet LoginStart(serverbound, Login, 0x00) { String name } packet EncryptionResponse(serverbound, Login, 0x01) { u16 shared_secret_length = len(shared_secret) List[u8] shared_secret u16 verify_token_length = len(verify_token) List[u8] verify_token } packet Disconnect(clientbound, Login, 0x00) { String json_data } packet EncryptionRequest(clientbound, Login, 0x01) { String server_id u16 public_key_length = len(public_key) List[u8] public_key u16 verify_token_length = len(verify_token) List[u8] verify_token } packet LoginSuccess(clientbound, Login, 0x02) { String uuid String username } // Play packet KeepAlive(serverbound, Play, 0x00) { i32 keep_alive_id } packet ChatMessage(serverbound, Play, 0x01) { String message } packet UseEntity(serverbound, Play, 0x02) { i32 target Mouse mouse } packet Player(serverbound, Play, 0x03) { bool on_ground } packet PlayerPosition(serverbound, Play, 0x04) { f64 x f64 feet_y f64 head_y f64 z bool on_ground } packet PlayerLook(serverbound, Play, 0x05) { f32 yaw f32 pitch bool on_ground } packet PlayerPositionAndLook(serverbound, Play, 0x06) { f64 x f64 feet_y f64 head_y f64 z f32 yaw f32 pitch bool on_ground } packet PlayerDigging(serverbound, Play, 0x07) { Status status i32 x u8 y i32 z Face face } packet PlayerBlockPlacement(serverbound, Play, 0x08) { i32 x u8 y i32 z i8 direction Slot held_item i8 cursor_x i8 cursor_y i8 cursor_z } packet HeldItemChange(serverbound, Play, 0x09) { i16 slot } packet Animation(serverbound, Play, 0x0A) { i32 entity_id Animation animation } packet EntityAction(serverbound, Play, 0x0B) { i32 entity_id EntityAction action i32 jump_boost } packet SteerVehicle(serverbound, Play, 0x0C) { f32 sideways f32 forward bool jump bool unmount } packet CloseWindow(serverbound, Play, 0x0D) { i8 window_id } // packet ClickWindow(serverbound, Play, 0x0E) { // i8 window_id //! TODO // i16 slot //! TODO // i8 button //! TODO // i16 action //! TODO // i8 mode //! TODO // Slot clicked_item //! TODO // }