aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/s_interact.rs
blob: 2f0494ae9997abe9c8665fa0d12dadf2e5f12241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use azalea_buf::AzBuf;
use azalea_core::{delta::LpVec3, entity_id::MinecraftEntityId};
use azalea_protocol_macros::ServerboundGamePacket;

#[derive(AzBuf, Clone, Debug, PartialEq, ServerboundGamePacket)]
pub struct ServerboundInteract {
    #[var]
    pub entity_id: MinecraftEntityId,
    pub hand: InteractionHand,
    pub location: LpVec3,
    /// Whether the player is sneaking.
    pub using_secondary_action: bool,
}

#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)]
pub enum InteractionHand {
    #[default]
    MainHand = 0,
    OffHand = 1,
}