Skip to main content

steel_protocol/packets/game/
c_respawn.rs

1//! Clientbound respawn packet - sent to respawn a player or change dimensions.
2
3use steel_macros::{ClientPacket, WriteTo};
4use steel_registry::packets::play::C_RESPAWN;
5
6use super::c_login::CommonPlayerSpawnInfo;
7
8/// Respawn a player in any dimension.
9///
10/// Sent by the server when a player respawns after death or changes dimensions.
11/// The client will reset its world state and prepare for new chunk data.
12#[derive(ClientPacket, WriteTo, Clone, Debug)]
13#[packet_id(Play = C_RESPAWN)]
14pub struct CRespawn {
15    /// Dimension and world state the player respawns into.
16    pub common_player_spawn_info: CommonPlayerSpawnInfo,
17    /// Bit field: 0x01 = keep attribute modifiers, 0x02 = keep entity data.
18    /// Set to 0 for a full reset (normal respawn).
19    pub data_kept: i8,
20}