mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
feat(bedrock) add & send health packet
This commit is contained in:
@@ -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;
|
||||
|
||||
18
pumpkin-protocol/src/bedrock/client/set_health.rs
Normal file
18
pumpkin-protocol/src/bedrock/client/set_health.rs
Normal 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),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user