Skip to main content

azalea_protocol/packets/game/
s_interact.rs

1use azalea_buf::AzBuf;
2use azalea_core::{delta::LpVec3, entity_id::MinecraftEntityId};
3use azalea_protocol_macros::ServerboundGamePacket;
4
5#[derive(AzBuf, Clone, Debug, PartialEq, ServerboundGamePacket)]
6pub struct ServerboundInteract {
7    #[var]
8    pub entity_id: MinecraftEntityId,
9    pub hand: InteractionHand,
10    pub location: LpVec3,
11    /// Whether the player is sneaking.
12    pub using_secondary_action: bool,
13}
14
15#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)]
16pub enum InteractionHand {
17    #[default]
18    MainHand = 0,
19    OffHand = 1,
20}