Skip to main content

steel_protocol/packets/game/
c_set_health.rs

1use steel_macros::{ClientPacket, WriteTo};
2use steel_registry::packets::play::C_SET_HEALTH;
3
4#[derive(ClientPacket, WriteTo, Clone, Debug)]
5#[packet_id(Play = C_SET_HEALTH)]
6pub struct CSetHealth {
7    /// 0 or less = dead, 20 = full HP.
8    pub health: f32,
9    /// 0–20
10    #[write(as = VarInt)]
11    pub food: i32,
12    /// Seems to vary from 0.0 to 5.0 in integer increments.
13    pub food_saturation: f32,
14}