feat(bedrock) add & send health packet

This commit is contained in:
Alexander Medvedev
2026-05-04 19:39:32 +02:00
parent bb0941bfeb
commit 26da644c1d
3 changed files with 39 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ pub mod resource_pack_stack;
pub mod resource_packs_info;
pub mod set_actor_data;
pub mod set_actor_motion;
pub mod set_health;
pub mod set_player_gamemode;
pub mod set_time;
pub mod set_title;

View File

@@ -0,0 +1,18 @@
use crate::{codec::var_int::VarInt, serial::PacketWrite};
use pumpkin_macros::packet;
#[derive(PacketWrite)]
#[packet(42)]
pub struct CSetHealth {
// https://mojang.github.io/bedrock-protocol-docs/html/SetHealthPacket.html
pub health: VarInt,
}
impl CSetHealth {
#[must_use]
pub const fn new(health: i32) -> Self {
Self {
health: VarInt(health),
}
}
}