steel_protocol/packets/game/c_change_difficulty.rs
1use steel_macros::{ClientPacket, WriteTo};
2use steel_registry::packets::play::C_CHANGE_DIFFICULTY;
3use steel_utils::types::Difficulty;
4
5/// Clientbound packet that informs the client about the current world difficulty.
6///
7/// Sent during login, respawn, and whenever the difficulty changes.
8#[derive(ClientPacket, WriteTo, Clone, Debug)]
9#[packet_id(Play = C_CHANGE_DIFFICULTY)]
10pub struct CChangeDifficulty {
11 /// The difficulty level.
12 pub difficulty: Difficulty,
13 /// Whether the difficulty is locked (prevents players from changing it).
14 pub locked: bool,
15}