steel_protocol/packets/game/c_entity_position_sync.rs
1use glam::DVec3;
2use steel_macros::{ClientPacket, WriteTo};
3use steel_registry::packets::play::C_ENTITY_POSITION_SYNC;
4
5/// Synchronizes an entity's position, velocity, and rotation.
6#[derive(ClientPacket, WriteTo, Clone, Debug)]
7#[packet_id(Play = C_ENTITY_POSITION_SYNC)]
8pub struct CEntityPositionSync {
9 #[write(as = VarInt)]
10 pub entity_id: i32,
11 pub pos: DVec3,
12 pub vel: DVec3,
13 /// Rotation on the X axis, in degrees
14 pub yaw: f32,
15 /// Rotation on the Y axis, in degrees
16 pub pitch: f32,
17 pub on_ground: bool,
18}