Its works, but block state ids are currently not mapped, meaning that when using the current default world gen the client mostly will disconnect due to a not found block state id, vanilla version compatible worlds should work
27 lines
824 B
Rust
27 lines
824 B
Rust
use pumpkin_data::packet::clientbound::PLAY_HURT_ANIMATION;
|
|
use pumpkin_macros::java_packet;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::VarInt;
|
|
|
|
/// Triggers the "hurt" visual effect on an entity.
|
|
///
|
|
/// This packet causes the entity to turn red and perform a directional
|
|
/// camera shake or model tilt. It is typically sent immediately after
|
|
/// an entity's health is reduced.
|
|
#[derive(Serialize, Deserialize)]
|
|
#[java_packet(PLAY_HURT_ANIMATION)]
|
|
pub struct CHurtAnimation {
|
|
/// The Entity ID of the entity that was hurt.
|
|
pub entity_id: VarInt,
|
|
/// The yaw (direction) from which the damage originated.
|
|
/// This determines the direction the entity's model tilts.
|
|
pub yaw: f32,
|
|
}
|
|
|
|
impl CHurtAnimation {
|
|
pub fn new(entity_id: VarInt, yaw: f32) -> Self {
|
|
Self { entity_id, yaw }
|
|
}
|
|
}
|