steel_protocol/packets/game/c_remove_entities.rs
1//! Packet sent to remove entities from the client.
2
3use steel_macros::{ClientPacket, WriteTo};
4use steel_registry::packets::play::C_REMOVE_ENTITIES;
5
6/// Removes one or more entities from the client.
7#[derive(ClientPacket, WriteTo, Clone, Debug)]
8#[packet_id(Play = C_REMOVE_ENTITIES)]
9pub struct CRemoveEntities {
10 /// The entity IDs to remove
11 #[write(as = Prefixed(VarInt, inner = VarInt))]
12 pub entity_ids: Vec<i32>,
13}
14
15impl CRemoveEntities {
16 /// Creates a packet to remove a single entity.
17 #[must_use]
18 pub fn single(entity_id: i32) -> Self {
19 Self {
20 entity_ids: vec![entity_id],
21 }
22 }
23}