azalea_protocol/packets/game/
s_player_action.rs

1use azalea_buf::AzBuf;
2use azalea_core::direction::Direction;
3use azalea_core::position::BlockPos;
4use azalea_protocol_macros::ServerboundGamePacket;
5
6#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
7pub struct ServerboundPlayerAction {
8    pub action: Action,
9    pub pos: BlockPos,
10    pub direction: Direction,
11    #[var]
12    pub sequence: u32,
13}
14
15#[derive(AzBuf, Clone, Copy, Debug)]
16pub enum Action {
17    StartDestroyBlock = 0,
18    AbortDestroyBlock = 1,
19    StopDestroyBlock = 2,
20    DropAllItems = 3,
21    DropItem = 4,
22    ReleaseUseItem = 5,
23    SwapItemWithOffhand = 6,
24}