Skip to main content

ghast_protocol/generated/v1_12_2/play/
clientbound.rs

1// @generated by ghast-codegen-protocol from PrismarineJS minecraft-data 3.119.0
2// (data/pc/1.12.2/protocol.json, Minecraft 1.12.2). Do not edit; run `cargo run -p ghast-codegen-protocol`.
3// minecraft-data is MIT licensed, Copyright (c) 2015 PrismarineJS; see the NOTICE file
4// in crates/ghast-protocol/src/generated/.
5
6//! Clientbound packets of the play state.
7
8#![allow(
9    unused_imports,
10    unused_variables,
11    unused_mut,
12    unused_parens,
13    unused_braces,
14    clippy::all,
15    clippy::pedantic,
16    non_camel_case_types,
17    non_snake_case
18)]
19use crate::codec::{Decode, DecodeResult, Encode, EncodeResult, McWrite, Reader, decode_exact};
20use crate::error::{DecodeError, EncodeError};
21use crate::nbt::{AnonNbt, RawNbt};
22use crate::packet::{Direction, PacketSet, RawPacket, State};
23#[cfg(feature = "testgen")]
24use crate::testgen::{Gen, Generate};
25use crate::types::{BlockPos, ByteString, Holder, HolderSet, LpVec3, PositionLayout, Uuid};
26use bytes::{BufMut, Bytes, BytesMut};
27
28/// Packet ids.
29pub mod id {
30    /// `spawn_entity`
31    pub const SPAWN_ENTITY: i32 = 0x00;
32    /// `spawn_entity_experience_orb`
33    pub const SPAWN_ENTITY_EXPERIENCE_ORB: i32 = 0x01;
34    /// `spawn_entity_weather`
35    pub const SPAWN_ENTITY_WEATHER: i32 = 0x02;
36    /// `spawn_entity_living`
37    pub const SPAWN_ENTITY_LIVING: i32 = 0x03;
38    /// `spawn_entity_painting`
39    pub const SPAWN_ENTITY_PAINTING: i32 = 0x04;
40    /// `named_entity_spawn`
41    pub const NAMED_ENTITY_SPAWN: i32 = 0x05;
42    /// `animation`
43    pub const ANIMATION: i32 = 0x06;
44    /// `statistics`
45    pub const STATISTICS: i32 = 0x07;
46    /// `block_break_animation`
47    pub const BLOCK_BREAK_ANIMATION: i32 = 0x08;
48    /// `tile_entity_data`
49    pub const TILE_ENTITY_DATA: i32 = 0x09;
50    /// `block_action`
51    pub const BLOCK_ACTION: i32 = 0x0a;
52    /// `block_change`
53    pub const BLOCK_CHANGE: i32 = 0x0b;
54    /// `boss_bar`
55    pub const BOSS_BAR: i32 = 0x0c;
56    /// `difficulty`
57    pub const DIFFICULTY: i32 = 0x0d;
58    /// `tab_complete`
59    pub const TAB_COMPLETE: i32 = 0x0e;
60    /// `chat`
61    pub const CHAT: i32 = 0x0f;
62    /// `multi_block_change`
63    pub const MULTI_BLOCK_CHANGE: i32 = 0x10;
64    /// `transaction`
65    pub const TRANSACTION: i32 = 0x11;
66    /// `close_window`
67    pub const CLOSE_WINDOW: i32 = 0x12;
68    /// `open_window`
69    pub const OPEN_WINDOW: i32 = 0x13;
70    /// `window_items`
71    pub const WINDOW_ITEMS: i32 = 0x14;
72    /// `craft_progress_bar`
73    pub const CRAFT_PROGRESS_BAR: i32 = 0x15;
74    /// `set_slot`
75    pub const SET_SLOT: i32 = 0x16;
76    /// `set_cooldown`
77    pub const SET_COOLDOWN: i32 = 0x17;
78    /// `custom_payload`
79    pub const CUSTOM_PAYLOAD: i32 = 0x18;
80    /// `named_sound_effect`
81    pub const NAMED_SOUND_EFFECT: i32 = 0x19;
82    /// `kick_disconnect`
83    pub const KICK_DISCONNECT: i32 = 0x1a;
84    /// `entity_status`
85    pub const ENTITY_STATUS: i32 = 0x1b;
86    /// `explosion`
87    pub const EXPLOSION: i32 = 0x1c;
88    /// `unload_chunk`
89    pub const UNLOAD_CHUNK: i32 = 0x1d;
90    /// `game_state_change`
91    pub const GAME_STATE_CHANGE: i32 = 0x1e;
92    /// `keep_alive`
93    pub const KEEP_ALIVE: i32 = 0x1f;
94    /// `map_chunk`
95    pub const MAP_CHUNK: i32 = 0x20;
96    /// `world_event`
97    pub const WORLD_EVENT: i32 = 0x21;
98    /// `world_particles`
99    pub const WORLD_PARTICLES: i32 = 0x22;
100    /// `login`
101    pub const LOGIN: i32 = 0x23;
102    /// `map`
103    pub const MAP: i32 = 0x24;
104    /// `entity`
105    pub const ENTITY: i32 = 0x25;
106    /// `rel_entity_move`
107    pub const REL_ENTITY_MOVE: i32 = 0x26;
108    /// `entity_move_look`
109    pub const ENTITY_MOVE_LOOK: i32 = 0x27;
110    /// `entity_look`
111    pub const ENTITY_LOOK: i32 = 0x28;
112    /// `vehicle_move`
113    pub const VEHICLE_MOVE: i32 = 0x29;
114    /// `open_sign_entity`
115    pub const OPEN_SIGN_ENTITY: i32 = 0x2a;
116    /// `craft_recipe_response`
117    pub const CRAFT_RECIPE_RESPONSE: i32 = 0x2b;
118    /// `abilities`
119    pub const ABILITIES: i32 = 0x2c;
120    /// `combat_event`
121    pub const COMBAT_EVENT: i32 = 0x2d;
122    /// `player_info`
123    pub const PLAYER_INFO: i32 = 0x2e;
124    /// `position`
125    pub const POSITION: i32 = 0x2f;
126    /// `bed`
127    pub const BED: i32 = 0x30;
128    /// `unlock_recipes`
129    pub const UNLOCK_RECIPES: i32 = 0x31;
130    /// `entity_destroy`
131    pub const ENTITY_DESTROY: i32 = 0x32;
132    /// `remove_entity_effect`
133    pub const REMOVE_ENTITY_EFFECT: i32 = 0x33;
134    /// `resource_pack_send`
135    pub const RESOURCE_PACK_SEND: i32 = 0x34;
136    /// `respawn`
137    pub const RESPAWN: i32 = 0x35;
138    /// `entity_head_rotation`
139    pub const ENTITY_HEAD_ROTATION: i32 = 0x36;
140    /// `select_advancement_tab`
141    pub const SELECT_ADVANCEMENT_TAB: i32 = 0x37;
142    /// `world_border`
143    pub const WORLD_BORDER: i32 = 0x38;
144    /// `camera`
145    pub const CAMERA: i32 = 0x39;
146    /// `held_item_slot`
147    pub const HELD_ITEM_SLOT: i32 = 0x3a;
148    /// `scoreboard_display_objective`
149    pub const SCOREBOARD_DISPLAY_OBJECTIVE: i32 = 0x3b;
150    /// `entity_metadata`
151    pub const ENTITY_METADATA: i32 = 0x3c;
152    /// `attach_entity`
153    pub const ATTACH_ENTITY: i32 = 0x3d;
154    /// `entity_velocity`
155    pub const ENTITY_VELOCITY: i32 = 0x3e;
156    /// `entity_equipment`
157    pub const ENTITY_EQUIPMENT: i32 = 0x3f;
158    /// `experience`
159    pub const EXPERIENCE: i32 = 0x40;
160    /// `update_health`
161    pub const UPDATE_HEALTH: i32 = 0x41;
162    /// `scoreboard_objective`
163    pub const SCOREBOARD_OBJECTIVE: i32 = 0x42;
164    /// `set_passengers`
165    pub const SET_PASSENGERS: i32 = 0x43;
166    /// `teams`
167    pub const TEAMS: i32 = 0x44;
168    /// `scoreboard_score`
169    pub const SCOREBOARD_SCORE: i32 = 0x45;
170    /// `spawn_position`
171    pub const SPAWN_POSITION: i32 = 0x46;
172    /// `update_time`
173    pub const UPDATE_TIME: i32 = 0x47;
174    /// `title`
175    pub const TITLE: i32 = 0x48;
176    /// `sound_effect`
177    pub const SOUND_EFFECT: i32 = 0x49;
178    /// `playerlist_header`
179    pub const PLAYERLIST_HEADER: i32 = 0x4a;
180    /// `collect`
181    pub const COLLECT: i32 = 0x4b;
182    /// `entity_teleport`
183    pub const ENTITY_TELEPORT: i32 = 0x4c;
184    /// `advancements`
185    pub const ADVANCEMENTS: i32 = 0x4d;
186    /// `entity_update_attributes`
187    pub const ENTITY_UPDATE_ATTRIBUTES: i32 = 0x4e;
188    /// `entity_effect`
189    pub const ENTITY_EFFECT: i32 = 0x4f;
190}
191
192pub use crate::defs::p47::play::clientbound::DifficultyDifficulty;
193pub use crate::defs::p47::play::clientbound::ExplosionAffectedBlockOffsets;
194pub use crate::defs::p47::play::clientbound::GameStateChangeReason;
195pub use crate::defs::p47::play::clientbound::MapIcons;
196pub use crate::defs::p47::play::clientbound::MultiBlockChangeRecords;
197pub use crate::defs::p47::play::clientbound::PlayerInfoAction;
198pub use crate::defs::p47::play::clientbound::PlayerInfoData;
199pub use crate::defs::p47::play::clientbound::PlayerInfoDataBody;
200pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyAddPlayer;
201pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyAddPlayerProperties;
202pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateDisplayName;
203pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateGameMode;
204pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateLatency;
205pub use crate::defs::p47::play::clientbound::StatisticsEntries;
206pub use crate::defs::p47::play::clientbound::WorldParticlesData;
207pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMapping;
208pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValue;
209pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueCriteria;
210pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueDisplayData;
211pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueDisplayDataFlags;
212pub use crate::defs::p340::play::clientbound::AdvancementsProgressMapping;
213pub use crate::defs::p340::play::clientbound::AdvancementsProgressMappingValue;
214pub use crate::defs::p340::play::clientbound::EntityUpdateAttributesProperties;
215pub use crate::defs::p340::play::clientbound::EntityUpdateAttributesPropertiesModifiers;
216
217/// `spawn_entity` (clientbound play, id 0x00).
218pub type SpawnEntity = crate::defs::p340::play::clientbound::SpawnEntity<340>;
219impl crate::packet::Packet for SpawnEntity {
220    const ID: i32 = id::SPAWN_ENTITY;
221    const NAME: &'static str = "spawn_entity";
222    const STATE: State = State::Play;
223    const DIRECTION: Direction = Direction::Clientbound;
224}
225impl From<SpawnEntity> for ClientboundPlayPacket {
226    fn from(p: SpawnEntity) -> Self {
227        Self::SpawnEntity(p)
228    }
229}
230
231/// `spawn_entity_experience_orb` (clientbound play, id 0x01).
232pub type SpawnEntityExperienceOrb =
233    crate::defs::p340::play::clientbound::SpawnEntityExperienceOrb<340>;
234impl crate::packet::Packet for SpawnEntityExperienceOrb {
235    const ID: i32 = id::SPAWN_ENTITY_EXPERIENCE_ORB;
236    const NAME: &'static str = "spawn_entity_experience_orb";
237    const STATE: State = State::Play;
238    const DIRECTION: Direction = Direction::Clientbound;
239}
240impl From<SpawnEntityExperienceOrb> for ClientboundPlayPacket {
241    fn from(p: SpawnEntityExperienceOrb) -> Self {
242        Self::SpawnEntityExperienceOrb(p)
243    }
244}
245
246/// `spawn_entity_weather` (clientbound play, id 0x02).
247pub type SpawnEntityWeather = crate::defs::p340::play::clientbound::SpawnEntityWeather<340>;
248impl crate::packet::Packet for SpawnEntityWeather {
249    const ID: i32 = id::SPAWN_ENTITY_WEATHER;
250    const NAME: &'static str = "spawn_entity_weather";
251    const STATE: State = State::Play;
252    const DIRECTION: Direction = Direction::Clientbound;
253}
254impl From<SpawnEntityWeather> for ClientboundPlayPacket {
255    fn from(p: SpawnEntityWeather) -> Self {
256        Self::SpawnEntityWeather(p)
257    }
258}
259
260/// `spawn_entity_living` (clientbound play, id 0x03).
261pub type SpawnEntityLiving = crate::defs::p340::play::clientbound::SpawnEntityLiving<340>;
262impl crate::packet::Packet for SpawnEntityLiving {
263    const ID: i32 = id::SPAWN_ENTITY_LIVING;
264    const NAME: &'static str = "spawn_entity_living";
265    const STATE: State = State::Play;
266    const DIRECTION: Direction = Direction::Clientbound;
267}
268impl From<SpawnEntityLiving> for ClientboundPlayPacket {
269    fn from(p: SpawnEntityLiving) -> Self {
270        Self::SpawnEntityLiving(p)
271    }
272}
273
274/// `spawn_entity_painting` (clientbound play, id 0x04).
275pub type SpawnEntityPainting = crate::defs::p340::play::clientbound::SpawnEntityPainting<340>;
276impl crate::packet::Packet for SpawnEntityPainting {
277    const ID: i32 = id::SPAWN_ENTITY_PAINTING;
278    const NAME: &'static str = "spawn_entity_painting";
279    const STATE: State = State::Play;
280    const DIRECTION: Direction = Direction::Clientbound;
281}
282impl From<SpawnEntityPainting> for ClientboundPlayPacket {
283    fn from(p: SpawnEntityPainting) -> Self {
284        Self::SpawnEntityPainting(p)
285    }
286}
287
288/// `named_entity_spawn` (clientbound play, id 0x05).
289pub type NamedEntitySpawn = crate::defs::p340::play::clientbound::NamedEntitySpawn<340>;
290impl crate::packet::Packet for NamedEntitySpawn {
291    const ID: i32 = id::NAMED_ENTITY_SPAWN;
292    const NAME: &'static str = "named_entity_spawn";
293    const STATE: State = State::Play;
294    const DIRECTION: Direction = Direction::Clientbound;
295}
296impl From<NamedEntitySpawn> for ClientboundPlayPacket {
297    fn from(p: NamedEntitySpawn) -> Self {
298        Self::NamedEntitySpawn(p)
299    }
300}
301
302/// `animation` (clientbound play, id 0x06).
303pub type Animation = crate::defs::p47::play::clientbound::Animation<340>;
304impl crate::packet::Packet for Animation {
305    const ID: i32 = id::ANIMATION;
306    const NAME: &'static str = "animation";
307    const STATE: State = State::Play;
308    const DIRECTION: Direction = Direction::Clientbound;
309}
310impl From<Animation> for ClientboundPlayPacket {
311    fn from(p: Animation) -> Self {
312        Self::Animation(p)
313    }
314}
315
316/// `statistics` (clientbound play, id 0x07).
317pub type Statistics = crate::defs::p47::play::clientbound::Statistics<340>;
318impl crate::packet::Packet for Statistics {
319    const ID: i32 = id::STATISTICS;
320    const NAME: &'static str = "statistics";
321    const STATE: State = State::Play;
322    const DIRECTION: Direction = Direction::Clientbound;
323}
324impl From<Statistics> for ClientboundPlayPacket {
325    fn from(p: Statistics) -> Self {
326        Self::Statistics(p)
327    }
328}
329
330/// `block_break_animation` (clientbound play, id 0x08).
331pub type BlockBreakAnimation = crate::defs::p47::play::clientbound::BlockBreakAnimation<340>;
332impl crate::packet::Packet for BlockBreakAnimation {
333    const ID: i32 = id::BLOCK_BREAK_ANIMATION;
334    const NAME: &'static str = "block_break_animation";
335    const STATE: State = State::Play;
336    const DIRECTION: Direction = Direction::Clientbound;
337}
338impl From<BlockBreakAnimation> for ClientboundPlayPacket {
339    fn from(p: BlockBreakAnimation) -> Self {
340        Self::BlockBreakAnimation(p)
341    }
342}
343
344/// `tile_entity_data` (clientbound play, id 0x09).
345pub type TileEntityData = crate::defs::p47::play::clientbound::TileEntityData<340>;
346impl crate::packet::Packet for TileEntityData {
347    const ID: i32 = id::TILE_ENTITY_DATA;
348    const NAME: &'static str = "tile_entity_data";
349    const STATE: State = State::Play;
350    const DIRECTION: Direction = Direction::Clientbound;
351}
352impl From<TileEntityData> for ClientboundPlayPacket {
353    fn from(p: TileEntityData) -> Self {
354        Self::TileEntityData(p)
355    }
356}
357
358/// `block_action` (clientbound play, id 0x0a).
359pub type BlockAction = crate::defs::p47::play::clientbound::BlockAction<340>;
360impl crate::packet::Packet for BlockAction {
361    const ID: i32 = id::BLOCK_ACTION;
362    const NAME: &'static str = "block_action";
363    const STATE: State = State::Play;
364    const DIRECTION: Direction = Direction::Clientbound;
365}
366impl From<BlockAction> for ClientboundPlayPacket {
367    fn from(p: BlockAction) -> Self {
368        Self::BlockAction(p)
369    }
370}
371
372/// `block_change` (clientbound play, id 0x0b).
373pub type BlockChange = crate::defs::p47::play::clientbound::BlockChange<340>;
374impl crate::packet::Packet for BlockChange {
375    const ID: i32 = id::BLOCK_CHANGE;
376    const NAME: &'static str = "block_change";
377    const STATE: State = State::Play;
378    const DIRECTION: Direction = Direction::Clientbound;
379}
380impl From<BlockChange> for ClientboundPlayPacket {
381    fn from(p: BlockChange) -> Self {
382        Self::BlockChange(p)
383    }
384}
385
386/// `boss_bar` (clientbound play, id 0x0c).
387pub type BossBar = crate::defs::p340::play::clientbound::BossBar<340>;
388impl crate::packet::Packet for BossBar {
389    const ID: i32 = id::BOSS_BAR;
390    const NAME: &'static str = "boss_bar";
391    const STATE: State = State::Play;
392    const DIRECTION: Direction = Direction::Clientbound;
393}
394impl From<BossBar> for ClientboundPlayPacket {
395    fn from(p: BossBar) -> Self {
396        Self::BossBar(p)
397    }
398}
399
400/// `difficulty` (clientbound play, id 0x0d).
401pub type Difficulty = crate::defs::p47::play::clientbound::Difficulty<340>;
402impl crate::packet::Packet for Difficulty {
403    const ID: i32 = id::DIFFICULTY;
404    const NAME: &'static str = "difficulty";
405    const STATE: State = State::Play;
406    const DIRECTION: Direction = Direction::Clientbound;
407}
408impl From<Difficulty> for ClientboundPlayPacket {
409    fn from(p: Difficulty) -> Self {
410        Self::Difficulty(p)
411    }
412}
413
414/// `tab_complete` (clientbound play, id 0x0e).
415pub type TabComplete = crate::defs::p47::play::clientbound::TabComplete<340>;
416impl crate::packet::Packet for TabComplete {
417    const ID: i32 = id::TAB_COMPLETE;
418    const NAME: &'static str = "tab_complete";
419    const STATE: State = State::Play;
420    const DIRECTION: Direction = Direction::Clientbound;
421}
422impl From<TabComplete> for ClientboundPlayPacket {
423    fn from(p: TabComplete) -> Self {
424        Self::TabComplete(p)
425    }
426}
427
428/// `chat` (clientbound play, id 0x0f).
429pub type Chat = crate::defs::p47::play::clientbound::Chat<340>;
430impl crate::packet::Packet for Chat {
431    const ID: i32 = id::CHAT;
432    const NAME: &'static str = "chat";
433    const STATE: State = State::Play;
434    const DIRECTION: Direction = Direction::Clientbound;
435}
436impl From<Chat> for ClientboundPlayPacket {
437    fn from(p: Chat) -> Self {
438        Self::Chat(p)
439    }
440}
441
442/// `multi_block_change` (clientbound play, id 0x10).
443pub type MultiBlockChange = crate::defs::p47::play::clientbound::MultiBlockChange<340>;
444impl crate::packet::Packet for MultiBlockChange {
445    const ID: i32 = id::MULTI_BLOCK_CHANGE;
446    const NAME: &'static str = "multi_block_change";
447    const STATE: State = State::Play;
448    const DIRECTION: Direction = Direction::Clientbound;
449}
450impl From<MultiBlockChange> for ClientboundPlayPacket {
451    fn from(p: MultiBlockChange) -> Self {
452        Self::MultiBlockChange(p)
453    }
454}
455
456/// `transaction` (clientbound play, id 0x11).
457pub type Transaction = crate::defs::p47::play::clientbound::Transaction<340>;
458impl crate::packet::Packet for Transaction {
459    const ID: i32 = id::TRANSACTION;
460    const NAME: &'static str = "transaction";
461    const STATE: State = State::Play;
462    const DIRECTION: Direction = Direction::Clientbound;
463}
464impl From<Transaction> for ClientboundPlayPacket {
465    fn from(p: Transaction) -> Self {
466        Self::Transaction(p)
467    }
468}
469
470/// `close_window` (clientbound play, id 0x12).
471pub type CloseWindow = crate::defs::p47::play::clientbound::CloseWindow<340>;
472impl crate::packet::Packet for CloseWindow {
473    const ID: i32 = id::CLOSE_WINDOW;
474    const NAME: &'static str = "close_window";
475    const STATE: State = State::Play;
476    const DIRECTION: Direction = Direction::Clientbound;
477}
478impl From<CloseWindow> for ClientboundPlayPacket {
479    fn from(p: CloseWindow) -> Self {
480        Self::CloseWindow(p)
481    }
482}
483
484/// `open_window` (clientbound play, id 0x13).
485pub type OpenWindow = crate::defs::p47::play::clientbound::OpenWindow<340>;
486impl crate::packet::Packet for OpenWindow {
487    const ID: i32 = id::OPEN_WINDOW;
488    const NAME: &'static str = "open_window";
489    const STATE: State = State::Play;
490    const DIRECTION: Direction = Direction::Clientbound;
491}
492impl From<OpenWindow> for ClientboundPlayPacket {
493    fn from(p: OpenWindow) -> Self {
494        Self::OpenWindow(p)
495    }
496}
497
498/// `window_items` (clientbound play, id 0x14).
499pub type WindowItems = crate::defs::p47::play::clientbound::WindowItems<340>;
500impl crate::packet::Packet for WindowItems {
501    const ID: i32 = id::WINDOW_ITEMS;
502    const NAME: &'static str = "window_items";
503    const STATE: State = State::Play;
504    const DIRECTION: Direction = Direction::Clientbound;
505}
506impl From<WindowItems> for ClientboundPlayPacket {
507    fn from(p: WindowItems) -> Self {
508        Self::WindowItems(p)
509    }
510}
511
512/// `craft_progress_bar` (clientbound play, id 0x15).
513pub type CraftProgressBar = crate::defs::p47::play::clientbound::CraftProgressBar<340>;
514impl crate::packet::Packet for CraftProgressBar {
515    const ID: i32 = id::CRAFT_PROGRESS_BAR;
516    const NAME: &'static str = "craft_progress_bar";
517    const STATE: State = State::Play;
518    const DIRECTION: Direction = Direction::Clientbound;
519}
520impl From<CraftProgressBar> for ClientboundPlayPacket {
521    fn from(p: CraftProgressBar) -> Self {
522        Self::CraftProgressBar(p)
523    }
524}
525
526/// `set_slot` (clientbound play, id 0x16).
527pub type SetSlot = crate::defs::p47::play::clientbound::SetSlot<340>;
528impl crate::packet::Packet for SetSlot {
529    const ID: i32 = id::SET_SLOT;
530    const NAME: &'static str = "set_slot";
531    const STATE: State = State::Play;
532    const DIRECTION: Direction = Direction::Clientbound;
533}
534impl From<SetSlot> for ClientboundPlayPacket {
535    fn from(p: SetSlot) -> Self {
536        Self::SetSlot(p)
537    }
538}
539
540/// `set_cooldown` (clientbound play, id 0x17).
541pub type SetCooldown = crate::defs::p340::play::clientbound::SetCooldown<340>;
542impl crate::packet::Packet for SetCooldown {
543    const ID: i32 = id::SET_COOLDOWN;
544    const NAME: &'static str = "set_cooldown";
545    const STATE: State = State::Play;
546    const DIRECTION: Direction = Direction::Clientbound;
547}
548impl From<SetCooldown> for ClientboundPlayPacket {
549    fn from(p: SetCooldown) -> Self {
550        Self::SetCooldown(p)
551    }
552}
553
554/// `custom_payload` (clientbound play, id 0x18).
555pub type CustomPayload = crate::defs::p47::play::clientbound::CustomPayload<340>;
556impl crate::packet::Packet for CustomPayload {
557    const ID: i32 = id::CUSTOM_PAYLOAD;
558    const NAME: &'static str = "custom_payload";
559    const STATE: State = State::Play;
560    const DIRECTION: Direction = Direction::Clientbound;
561}
562impl From<CustomPayload> for ClientboundPlayPacket {
563    fn from(p: CustomPayload) -> Self {
564        Self::CustomPayload(p)
565    }
566}
567
568/// `named_sound_effect` (clientbound play, id 0x19).
569pub type NamedSoundEffect = crate::defs::p340::play::clientbound::NamedSoundEffect<340>;
570impl crate::packet::Packet for NamedSoundEffect {
571    const ID: i32 = id::NAMED_SOUND_EFFECT;
572    const NAME: &'static str = "named_sound_effect";
573    const STATE: State = State::Play;
574    const DIRECTION: Direction = Direction::Clientbound;
575}
576impl From<NamedSoundEffect> for ClientboundPlayPacket {
577    fn from(p: NamedSoundEffect) -> Self {
578        Self::NamedSoundEffect(p)
579    }
580}
581
582/// `kick_disconnect` (clientbound play, id 0x1a).
583pub type KickDisconnect = crate::defs::p47::play::clientbound::KickDisconnect<340>;
584impl crate::packet::Packet for KickDisconnect {
585    const ID: i32 = id::KICK_DISCONNECT;
586    const NAME: &'static str = "kick_disconnect";
587    const STATE: State = State::Play;
588    const DIRECTION: Direction = Direction::Clientbound;
589}
590impl From<KickDisconnect> for ClientboundPlayPacket {
591    fn from(p: KickDisconnect) -> Self {
592        Self::KickDisconnect(p)
593    }
594}
595
596/// `entity_status` (clientbound play, id 0x1b).
597pub type EntityStatus = crate::defs::p47::play::clientbound::EntityStatus<340>;
598impl crate::packet::Packet for EntityStatus {
599    const ID: i32 = id::ENTITY_STATUS;
600    const NAME: &'static str = "entity_status";
601    const STATE: State = State::Play;
602    const DIRECTION: Direction = Direction::Clientbound;
603}
604impl From<EntityStatus> for ClientboundPlayPacket {
605    fn from(p: EntityStatus) -> Self {
606        Self::EntityStatus(p)
607    }
608}
609
610/// `explosion` (clientbound play, id 0x1c).
611pub type Explosion = crate::defs::p47::play::clientbound::Explosion<340>;
612impl crate::packet::Packet for Explosion {
613    const ID: i32 = id::EXPLOSION;
614    const NAME: &'static str = "explosion";
615    const STATE: State = State::Play;
616    const DIRECTION: Direction = Direction::Clientbound;
617}
618impl From<Explosion> for ClientboundPlayPacket {
619    fn from(p: Explosion) -> Self {
620        Self::Explosion(p)
621    }
622}
623
624/// `unload_chunk` (clientbound play, id 0x1d).
625pub type UnloadChunk = crate::defs::p340::play::clientbound::UnloadChunk<340>;
626impl crate::packet::Packet for UnloadChunk {
627    const ID: i32 = id::UNLOAD_CHUNK;
628    const NAME: &'static str = "unload_chunk";
629    const STATE: State = State::Play;
630    const DIRECTION: Direction = Direction::Clientbound;
631}
632impl From<UnloadChunk> for ClientboundPlayPacket {
633    fn from(p: UnloadChunk) -> Self {
634        Self::UnloadChunk(p)
635    }
636}
637
638/// `game_state_change` (clientbound play, id 0x1e).
639pub type GameStateChange = crate::defs::p47::play::clientbound::GameStateChange<340>;
640impl crate::packet::Packet for GameStateChange {
641    const ID: i32 = id::GAME_STATE_CHANGE;
642    const NAME: &'static str = "game_state_change";
643    const STATE: State = State::Play;
644    const DIRECTION: Direction = Direction::Clientbound;
645}
646impl From<GameStateChange> for ClientboundPlayPacket {
647    fn from(p: GameStateChange) -> Self {
648        Self::GameStateChange(p)
649    }
650}
651
652/// `keep_alive` (clientbound play, id 0x1f).
653pub type KeepAlive = crate::defs::p340::play::clientbound::KeepAlive<340>;
654impl crate::packet::Packet for KeepAlive {
655    const ID: i32 = id::KEEP_ALIVE;
656    const NAME: &'static str = "keep_alive";
657    const STATE: State = State::Play;
658    const DIRECTION: Direction = Direction::Clientbound;
659}
660impl From<KeepAlive> for ClientboundPlayPacket {
661    fn from(p: KeepAlive) -> Self {
662        Self::KeepAlive(p)
663    }
664}
665
666/// `map_chunk` (clientbound play, id 0x20).
667pub type MapChunk = crate::defs::p340::play::clientbound::MapChunk<340>;
668impl crate::packet::Packet for MapChunk {
669    const ID: i32 = id::MAP_CHUNK;
670    const NAME: &'static str = "map_chunk";
671    const STATE: State = State::Play;
672    const DIRECTION: Direction = Direction::Clientbound;
673}
674impl From<MapChunk> for ClientboundPlayPacket {
675    fn from(p: MapChunk) -> Self {
676        Self::MapChunk(p)
677    }
678}
679
680/// `world_event` (clientbound play, id 0x21).
681pub type WorldEvent = crate::defs::p47::play::clientbound::WorldEvent<340>;
682impl crate::packet::Packet for WorldEvent {
683    const ID: i32 = id::WORLD_EVENT;
684    const NAME: &'static str = "world_event";
685    const STATE: State = State::Play;
686    const DIRECTION: Direction = Direction::Clientbound;
687}
688impl From<WorldEvent> for ClientboundPlayPacket {
689    fn from(p: WorldEvent) -> Self {
690        Self::WorldEvent(p)
691    }
692}
693
694/// `world_particles` (clientbound play, id 0x22).
695pub type WorldParticles = crate::defs::p47::play::clientbound::WorldParticles<340>;
696impl crate::packet::Packet for WorldParticles {
697    const ID: i32 = id::WORLD_PARTICLES;
698    const NAME: &'static str = "world_particles";
699    const STATE: State = State::Play;
700    const DIRECTION: Direction = Direction::Clientbound;
701}
702impl From<WorldParticles> for ClientboundPlayPacket {
703    fn from(p: WorldParticles) -> Self {
704        Self::WorldParticles(p)
705    }
706}
707
708/// `login` (clientbound play, id 0x23).
709pub type Login = crate::defs::p340::play::clientbound::Login<340>;
710impl crate::packet::Packet for Login {
711    const ID: i32 = id::LOGIN;
712    const NAME: &'static str = "login";
713    const STATE: State = State::Play;
714    const DIRECTION: Direction = Direction::Clientbound;
715}
716impl From<Login> for ClientboundPlayPacket {
717    fn from(p: Login) -> Self {
718        Self::Login(p)
719    }
720}
721
722/// `map` (clientbound play, id 0x24).
723pub type Map = crate::defs::p340::play::clientbound::Map<340>;
724impl crate::packet::Packet for Map {
725    const ID: i32 = id::MAP;
726    const NAME: &'static str = "map";
727    const STATE: State = State::Play;
728    const DIRECTION: Direction = Direction::Clientbound;
729}
730impl From<Map> for ClientboundPlayPacket {
731    fn from(p: Map) -> Self {
732        Self::Map(p)
733    }
734}
735
736/// `entity` (clientbound play, id 0x25).
737pub type Entity = crate::defs::p47::play::clientbound::Entity<340>;
738impl crate::packet::Packet for Entity {
739    const ID: i32 = id::ENTITY;
740    const NAME: &'static str = "entity";
741    const STATE: State = State::Play;
742    const DIRECTION: Direction = Direction::Clientbound;
743}
744impl From<Entity> for ClientboundPlayPacket {
745    fn from(p: Entity) -> Self {
746        Self::Entity(p)
747    }
748}
749
750/// `rel_entity_move` (clientbound play, id 0x26).
751pub type RelEntityMove = crate::defs::p340::play::clientbound::RelEntityMove<340>;
752impl crate::packet::Packet for RelEntityMove {
753    const ID: i32 = id::REL_ENTITY_MOVE;
754    const NAME: &'static str = "rel_entity_move";
755    const STATE: State = State::Play;
756    const DIRECTION: Direction = Direction::Clientbound;
757}
758impl From<RelEntityMove> for ClientboundPlayPacket {
759    fn from(p: RelEntityMove) -> Self {
760        Self::RelEntityMove(p)
761    }
762}
763
764/// `entity_move_look` (clientbound play, id 0x27).
765pub type EntityMoveLook = crate::defs::p340::play::clientbound::EntityMoveLook<340>;
766impl crate::packet::Packet for EntityMoveLook {
767    const ID: i32 = id::ENTITY_MOVE_LOOK;
768    const NAME: &'static str = "entity_move_look";
769    const STATE: State = State::Play;
770    const DIRECTION: Direction = Direction::Clientbound;
771}
772impl From<EntityMoveLook> for ClientboundPlayPacket {
773    fn from(p: EntityMoveLook) -> Self {
774        Self::EntityMoveLook(p)
775    }
776}
777
778/// `entity_look` (clientbound play, id 0x28).
779pub type EntityLook = crate::defs::p47::play::clientbound::EntityLook<340>;
780impl crate::packet::Packet for EntityLook {
781    const ID: i32 = id::ENTITY_LOOK;
782    const NAME: &'static str = "entity_look";
783    const STATE: State = State::Play;
784    const DIRECTION: Direction = Direction::Clientbound;
785}
786impl From<EntityLook> for ClientboundPlayPacket {
787    fn from(p: EntityLook) -> Self {
788        Self::EntityLook(p)
789    }
790}
791
792/// `vehicle_move` (clientbound play, id 0x29).
793pub type VehicleMove = crate::defs::p340::play::clientbound::VehicleMove<340>;
794impl crate::packet::Packet for VehicleMove {
795    const ID: i32 = id::VEHICLE_MOVE;
796    const NAME: &'static str = "vehicle_move";
797    const STATE: State = State::Play;
798    const DIRECTION: Direction = Direction::Clientbound;
799}
800impl From<VehicleMove> for ClientboundPlayPacket {
801    fn from(p: VehicleMove) -> Self {
802        Self::VehicleMove(p)
803    }
804}
805
806/// `open_sign_entity` (clientbound play, id 0x2a).
807pub type OpenSignEntity = crate::defs::p47::play::clientbound::OpenSignEntity<340>;
808impl crate::packet::Packet for OpenSignEntity {
809    const ID: i32 = id::OPEN_SIGN_ENTITY;
810    const NAME: &'static str = "open_sign_entity";
811    const STATE: State = State::Play;
812    const DIRECTION: Direction = Direction::Clientbound;
813}
814impl From<OpenSignEntity> for ClientboundPlayPacket {
815    fn from(p: OpenSignEntity) -> Self {
816        Self::OpenSignEntity(p)
817    }
818}
819
820/// `craft_recipe_response` (clientbound play, id 0x2b).
821pub type CraftRecipeResponse = crate::defs::p340::play::clientbound::CraftRecipeResponse<340>;
822impl crate::packet::Packet for CraftRecipeResponse {
823    const ID: i32 = id::CRAFT_RECIPE_RESPONSE;
824    const NAME: &'static str = "craft_recipe_response";
825    const STATE: State = State::Play;
826    const DIRECTION: Direction = Direction::Clientbound;
827}
828impl From<CraftRecipeResponse> for ClientboundPlayPacket {
829    fn from(p: CraftRecipeResponse) -> Self {
830        Self::CraftRecipeResponse(p)
831    }
832}
833
834/// `abilities` (clientbound play, id 0x2c).
835pub type Abilities = crate::defs::p47::play::clientbound::Abilities<340>;
836impl crate::packet::Packet for Abilities {
837    const ID: i32 = id::ABILITIES;
838    const NAME: &'static str = "abilities";
839    const STATE: State = State::Play;
840    const DIRECTION: Direction = Direction::Clientbound;
841}
842impl From<Abilities> for ClientboundPlayPacket {
843    fn from(p: Abilities) -> Self {
844        Self::Abilities(p)
845    }
846}
847
848/// `combat_event` (clientbound play, id 0x2d).
849pub type CombatEvent = crate::defs::p47::play::clientbound::CombatEvent<340>;
850impl crate::packet::Packet for CombatEvent {
851    const ID: i32 = id::COMBAT_EVENT;
852    const NAME: &'static str = "combat_event";
853    const STATE: State = State::Play;
854    const DIRECTION: Direction = Direction::Clientbound;
855}
856impl From<CombatEvent> for ClientboundPlayPacket {
857    fn from(p: CombatEvent) -> Self {
858        Self::CombatEvent(p)
859    }
860}
861
862/// `player_info` (clientbound play, id 0x2e).
863pub type PlayerInfo = crate::defs::p47::play::clientbound::PlayerInfo<340>;
864impl crate::packet::Packet for PlayerInfo {
865    const ID: i32 = id::PLAYER_INFO;
866    const NAME: &'static str = "player_info";
867    const STATE: State = State::Play;
868    const DIRECTION: Direction = Direction::Clientbound;
869}
870impl From<PlayerInfo> for ClientboundPlayPacket {
871    fn from(p: PlayerInfo) -> Self {
872        Self::PlayerInfo(p)
873    }
874}
875
876/// `position` (clientbound play, id 0x2f).
877pub type Position = crate::defs::p340::play::clientbound::Position<340>;
878impl crate::packet::Packet for Position {
879    const ID: i32 = id::POSITION;
880    const NAME: &'static str = "position";
881    const STATE: State = State::Play;
882    const DIRECTION: Direction = Direction::Clientbound;
883}
884impl From<Position> for ClientboundPlayPacket {
885    fn from(p: Position) -> Self {
886        Self::Position(p)
887    }
888}
889
890/// `bed` (clientbound play, id 0x30).
891pub type Bed = crate::defs::p47::play::clientbound::Bed<340>;
892impl crate::packet::Packet for Bed {
893    const ID: i32 = id::BED;
894    const NAME: &'static str = "bed";
895    const STATE: State = State::Play;
896    const DIRECTION: Direction = Direction::Clientbound;
897}
898impl From<Bed> for ClientboundPlayPacket {
899    fn from(p: Bed) -> Self {
900        Self::Bed(p)
901    }
902}
903
904/// `unlock_recipes` (clientbound play, id 0x31).
905pub type UnlockRecipes = crate::defs::p340::play::clientbound::UnlockRecipes<340>;
906impl crate::packet::Packet for UnlockRecipes {
907    const ID: i32 = id::UNLOCK_RECIPES;
908    const NAME: &'static str = "unlock_recipes";
909    const STATE: State = State::Play;
910    const DIRECTION: Direction = Direction::Clientbound;
911}
912impl From<UnlockRecipes> for ClientboundPlayPacket {
913    fn from(p: UnlockRecipes) -> Self {
914        Self::UnlockRecipes(p)
915    }
916}
917
918/// `entity_destroy` (clientbound play, id 0x32).
919pub type EntityDestroy = crate::defs::p47::play::clientbound::EntityDestroy<340>;
920impl crate::packet::Packet for EntityDestroy {
921    const ID: i32 = id::ENTITY_DESTROY;
922    const NAME: &'static str = "entity_destroy";
923    const STATE: State = State::Play;
924    const DIRECTION: Direction = Direction::Clientbound;
925}
926impl From<EntityDestroy> for ClientboundPlayPacket {
927    fn from(p: EntityDestroy) -> Self {
928        Self::EntityDestroy(p)
929    }
930}
931
932/// `remove_entity_effect` (clientbound play, id 0x33).
933pub type RemoveEntityEffect = crate::defs::p47::play::clientbound::RemoveEntityEffect<340>;
934impl crate::packet::Packet for RemoveEntityEffect {
935    const ID: i32 = id::REMOVE_ENTITY_EFFECT;
936    const NAME: &'static str = "remove_entity_effect";
937    const STATE: State = State::Play;
938    const DIRECTION: Direction = Direction::Clientbound;
939}
940impl From<RemoveEntityEffect> for ClientboundPlayPacket {
941    fn from(p: RemoveEntityEffect) -> Self {
942        Self::RemoveEntityEffect(p)
943    }
944}
945
946/// `resource_pack_send` (clientbound play, id 0x34).
947pub type ResourcePackSend = crate::defs::p47::play::clientbound::ResourcePackSend<340>;
948impl crate::packet::Packet for ResourcePackSend {
949    const ID: i32 = id::RESOURCE_PACK_SEND;
950    const NAME: &'static str = "resource_pack_send";
951    const STATE: State = State::Play;
952    const DIRECTION: Direction = Direction::Clientbound;
953}
954impl From<ResourcePackSend> for ClientboundPlayPacket {
955    fn from(p: ResourcePackSend) -> Self {
956        Self::ResourcePackSend(p)
957    }
958}
959
960/// `respawn` (clientbound play, id 0x35).
961pub type Respawn = crate::defs::p47::play::clientbound::Respawn<340>;
962impl crate::packet::Packet for Respawn {
963    const ID: i32 = id::RESPAWN;
964    const NAME: &'static str = "respawn";
965    const STATE: State = State::Play;
966    const DIRECTION: Direction = Direction::Clientbound;
967}
968impl From<Respawn> for ClientboundPlayPacket {
969    fn from(p: Respawn) -> Self {
970        Self::Respawn(p)
971    }
972}
973
974/// `entity_head_rotation` (clientbound play, id 0x36).
975pub type EntityHeadRotation = crate::defs::p47::play::clientbound::EntityHeadRotation<340>;
976impl crate::packet::Packet for EntityHeadRotation {
977    const ID: i32 = id::ENTITY_HEAD_ROTATION;
978    const NAME: &'static str = "entity_head_rotation";
979    const STATE: State = State::Play;
980    const DIRECTION: Direction = Direction::Clientbound;
981}
982impl From<EntityHeadRotation> for ClientboundPlayPacket {
983    fn from(p: EntityHeadRotation) -> Self {
984        Self::EntityHeadRotation(p)
985    }
986}
987
988/// `select_advancement_tab` (clientbound play, id 0x37).
989pub type SelectAdvancementTab = crate::defs::p340::play::clientbound::SelectAdvancementTab<340>;
990impl crate::packet::Packet for SelectAdvancementTab {
991    const ID: i32 = id::SELECT_ADVANCEMENT_TAB;
992    const NAME: &'static str = "select_advancement_tab";
993    const STATE: State = State::Play;
994    const DIRECTION: Direction = Direction::Clientbound;
995}
996impl From<SelectAdvancementTab> for ClientboundPlayPacket {
997    fn from(p: SelectAdvancementTab) -> Self {
998        Self::SelectAdvancementTab(p)
999    }
1000}
1001
1002/// `world_border` (clientbound play, id 0x38).
1003pub type WorldBorder = crate::defs::p47::play::clientbound::WorldBorder<340>;
1004impl crate::packet::Packet for WorldBorder {
1005    const ID: i32 = id::WORLD_BORDER;
1006    const NAME: &'static str = "world_border";
1007    const STATE: State = State::Play;
1008    const DIRECTION: Direction = Direction::Clientbound;
1009}
1010impl From<WorldBorder> for ClientboundPlayPacket {
1011    fn from(p: WorldBorder) -> Self {
1012        Self::WorldBorder(p)
1013    }
1014}
1015
1016/// `camera` (clientbound play, id 0x39).
1017pub type Camera = crate::defs::p47::play::clientbound::Camera<340>;
1018impl crate::packet::Packet for Camera {
1019    const ID: i32 = id::CAMERA;
1020    const NAME: &'static str = "camera";
1021    const STATE: State = State::Play;
1022    const DIRECTION: Direction = Direction::Clientbound;
1023}
1024impl From<Camera> for ClientboundPlayPacket {
1025    fn from(p: Camera) -> Self {
1026        Self::Camera(p)
1027    }
1028}
1029
1030/// `held_item_slot` (clientbound play, id 0x3a).
1031pub type HeldItemSlot = crate::defs::p47::play::clientbound::HeldItemSlot<340>;
1032impl crate::packet::Packet for HeldItemSlot {
1033    const ID: i32 = id::HELD_ITEM_SLOT;
1034    const NAME: &'static str = "held_item_slot";
1035    const STATE: State = State::Play;
1036    const DIRECTION: Direction = Direction::Clientbound;
1037}
1038impl From<HeldItemSlot> for ClientboundPlayPacket {
1039    fn from(p: HeldItemSlot) -> Self {
1040        Self::HeldItemSlot(p)
1041    }
1042}
1043
1044/// `scoreboard_display_objective` (clientbound play, id 0x3b).
1045pub type ScoreboardDisplayObjective =
1046    crate::defs::p47::play::clientbound::ScoreboardDisplayObjective<340>;
1047impl crate::packet::Packet for ScoreboardDisplayObjective {
1048    const ID: i32 = id::SCOREBOARD_DISPLAY_OBJECTIVE;
1049    const NAME: &'static str = "scoreboard_display_objective";
1050    const STATE: State = State::Play;
1051    const DIRECTION: Direction = Direction::Clientbound;
1052}
1053impl From<ScoreboardDisplayObjective> for ClientboundPlayPacket {
1054    fn from(p: ScoreboardDisplayObjective) -> Self {
1055        Self::ScoreboardDisplayObjective(p)
1056    }
1057}
1058
1059/// `entity_metadata` (clientbound play, id 0x3c).
1060pub type EntityMetadata = crate::defs::p340::play::clientbound::EntityMetadata<340>;
1061impl crate::packet::Packet for EntityMetadata {
1062    const ID: i32 = id::ENTITY_METADATA;
1063    const NAME: &'static str = "entity_metadata";
1064    const STATE: State = State::Play;
1065    const DIRECTION: Direction = Direction::Clientbound;
1066}
1067impl From<EntityMetadata> for ClientboundPlayPacket {
1068    fn from(p: EntityMetadata) -> Self {
1069        Self::EntityMetadata(p)
1070    }
1071}
1072
1073/// `attach_entity` (clientbound play, id 0x3d).
1074pub type AttachEntity = crate::defs::p340::play::clientbound::AttachEntity<340>;
1075impl crate::packet::Packet for AttachEntity {
1076    const ID: i32 = id::ATTACH_ENTITY;
1077    const NAME: &'static str = "attach_entity";
1078    const STATE: State = State::Play;
1079    const DIRECTION: Direction = Direction::Clientbound;
1080}
1081impl From<AttachEntity> for ClientboundPlayPacket {
1082    fn from(p: AttachEntity) -> Self {
1083        Self::AttachEntity(p)
1084    }
1085}
1086
1087/// `entity_velocity` (clientbound play, id 0x3e).
1088pub type EntityVelocity = crate::defs::p47::play::clientbound::EntityVelocity<340>;
1089impl crate::packet::Packet for EntityVelocity {
1090    const ID: i32 = id::ENTITY_VELOCITY;
1091    const NAME: &'static str = "entity_velocity";
1092    const STATE: State = State::Play;
1093    const DIRECTION: Direction = Direction::Clientbound;
1094}
1095impl From<EntityVelocity> for ClientboundPlayPacket {
1096    fn from(p: EntityVelocity) -> Self {
1097        Self::EntityVelocity(p)
1098    }
1099}
1100
1101/// `entity_equipment` (clientbound play, id 0x3f).
1102pub type EntityEquipment = crate::defs::p340::play::clientbound::EntityEquipment<340>;
1103impl crate::packet::Packet for EntityEquipment {
1104    const ID: i32 = id::ENTITY_EQUIPMENT;
1105    const NAME: &'static str = "entity_equipment";
1106    const STATE: State = State::Play;
1107    const DIRECTION: Direction = Direction::Clientbound;
1108}
1109impl From<EntityEquipment> for ClientboundPlayPacket {
1110    fn from(p: EntityEquipment) -> Self {
1111        Self::EntityEquipment(p)
1112    }
1113}
1114
1115/// `experience` (clientbound play, id 0x40).
1116pub type Experience = crate::defs::p47::play::clientbound::Experience<340>;
1117impl crate::packet::Packet for Experience {
1118    const ID: i32 = id::EXPERIENCE;
1119    const NAME: &'static str = "experience";
1120    const STATE: State = State::Play;
1121    const DIRECTION: Direction = Direction::Clientbound;
1122}
1123impl From<Experience> for ClientboundPlayPacket {
1124    fn from(p: Experience) -> Self {
1125        Self::Experience(p)
1126    }
1127}
1128
1129/// `update_health` (clientbound play, id 0x41).
1130pub type UpdateHealth = crate::defs::p47::play::clientbound::UpdateHealth<340>;
1131impl crate::packet::Packet for UpdateHealth {
1132    const ID: i32 = id::UPDATE_HEALTH;
1133    const NAME: &'static str = "update_health";
1134    const STATE: State = State::Play;
1135    const DIRECTION: Direction = Direction::Clientbound;
1136}
1137impl From<UpdateHealth> for ClientboundPlayPacket {
1138    fn from(p: UpdateHealth) -> Self {
1139        Self::UpdateHealth(p)
1140    }
1141}
1142
1143/// `scoreboard_objective` (clientbound play, id 0x42).
1144pub type ScoreboardObjective = crate::defs::p47::play::clientbound::ScoreboardObjective<340>;
1145impl crate::packet::Packet for ScoreboardObjective {
1146    const ID: i32 = id::SCOREBOARD_OBJECTIVE;
1147    const NAME: &'static str = "scoreboard_objective";
1148    const STATE: State = State::Play;
1149    const DIRECTION: Direction = Direction::Clientbound;
1150}
1151impl From<ScoreboardObjective> for ClientboundPlayPacket {
1152    fn from(p: ScoreboardObjective) -> Self {
1153        Self::ScoreboardObjective(p)
1154    }
1155}
1156
1157/// `set_passengers` (clientbound play, id 0x43).
1158pub type SetPassengers = crate::defs::p340::play::clientbound::SetPassengers<340>;
1159impl crate::packet::Packet for SetPassengers {
1160    const ID: i32 = id::SET_PASSENGERS;
1161    const NAME: &'static str = "set_passengers";
1162    const STATE: State = State::Play;
1163    const DIRECTION: Direction = Direction::Clientbound;
1164}
1165impl From<SetPassengers> for ClientboundPlayPacket {
1166    fn from(p: SetPassengers) -> Self {
1167        Self::SetPassengers(p)
1168    }
1169}
1170
1171/// `teams` (clientbound play, id 0x44).
1172pub type Teams = crate::defs::p340::play::clientbound::Teams<340>;
1173impl crate::packet::Packet for Teams {
1174    const ID: i32 = id::TEAMS;
1175    const NAME: &'static str = "teams";
1176    const STATE: State = State::Play;
1177    const DIRECTION: Direction = Direction::Clientbound;
1178}
1179impl From<Teams> for ClientboundPlayPacket {
1180    fn from(p: Teams) -> Self {
1181        Self::Teams(p)
1182    }
1183}
1184
1185/// `scoreboard_score` (clientbound play, id 0x45).
1186pub type ScoreboardScore = crate::defs::p47::play::clientbound::ScoreboardScore<340>;
1187impl crate::packet::Packet for ScoreboardScore {
1188    const ID: i32 = id::SCOREBOARD_SCORE;
1189    const NAME: &'static str = "scoreboard_score";
1190    const STATE: State = State::Play;
1191    const DIRECTION: Direction = Direction::Clientbound;
1192}
1193impl From<ScoreboardScore> for ClientboundPlayPacket {
1194    fn from(p: ScoreboardScore) -> Self {
1195        Self::ScoreboardScore(p)
1196    }
1197}
1198
1199/// `spawn_position` (clientbound play, id 0x46).
1200pub type SpawnPosition = crate::defs::p47::play::clientbound::SpawnPosition<340>;
1201impl crate::packet::Packet for SpawnPosition {
1202    const ID: i32 = id::SPAWN_POSITION;
1203    const NAME: &'static str = "spawn_position";
1204    const STATE: State = State::Play;
1205    const DIRECTION: Direction = Direction::Clientbound;
1206}
1207impl From<SpawnPosition> for ClientboundPlayPacket {
1208    fn from(p: SpawnPosition) -> Self {
1209        Self::SpawnPosition(p)
1210    }
1211}
1212
1213/// `update_time` (clientbound play, id 0x47).
1214pub type UpdateTime = crate::defs::p47::play::clientbound::UpdateTime<340>;
1215impl crate::packet::Packet for UpdateTime {
1216    const ID: i32 = id::UPDATE_TIME;
1217    const NAME: &'static str = "update_time";
1218    const STATE: State = State::Play;
1219    const DIRECTION: Direction = Direction::Clientbound;
1220}
1221impl From<UpdateTime> for ClientboundPlayPacket {
1222    fn from(p: UpdateTime) -> Self {
1223        Self::UpdateTime(p)
1224    }
1225}
1226
1227/// `title` (clientbound play, id 0x48).
1228pub type Title = crate::defs::p340::play::clientbound::Title<340>;
1229impl crate::packet::Packet for Title {
1230    const ID: i32 = id::TITLE;
1231    const NAME: &'static str = "title";
1232    const STATE: State = State::Play;
1233    const DIRECTION: Direction = Direction::Clientbound;
1234}
1235impl From<Title> for ClientboundPlayPacket {
1236    fn from(p: Title) -> Self {
1237        Self::Title(p)
1238    }
1239}
1240
1241/// `sound_effect` (clientbound play, id 0x49).
1242pub type SoundEffect = crate::defs::p340::play::clientbound::SoundEffect<340>;
1243impl crate::packet::Packet for SoundEffect {
1244    const ID: i32 = id::SOUND_EFFECT;
1245    const NAME: &'static str = "sound_effect";
1246    const STATE: State = State::Play;
1247    const DIRECTION: Direction = Direction::Clientbound;
1248}
1249impl From<SoundEffect> for ClientboundPlayPacket {
1250    fn from(p: SoundEffect) -> Self {
1251        Self::SoundEffect(p)
1252    }
1253}
1254
1255/// `playerlist_header` (clientbound play, id 0x4a).
1256pub type PlayerlistHeader = crate::defs::p47::play::clientbound::PlayerlistHeader<340>;
1257impl crate::packet::Packet for PlayerlistHeader {
1258    const ID: i32 = id::PLAYERLIST_HEADER;
1259    const NAME: &'static str = "playerlist_header";
1260    const STATE: State = State::Play;
1261    const DIRECTION: Direction = Direction::Clientbound;
1262}
1263impl From<PlayerlistHeader> for ClientboundPlayPacket {
1264    fn from(p: PlayerlistHeader) -> Self {
1265        Self::PlayerlistHeader(p)
1266    }
1267}
1268
1269/// `collect` (clientbound play, id 0x4b).
1270pub type Collect = crate::defs::p340::play::clientbound::Collect<340>;
1271impl crate::packet::Packet for Collect {
1272    const ID: i32 = id::COLLECT;
1273    const NAME: &'static str = "collect";
1274    const STATE: State = State::Play;
1275    const DIRECTION: Direction = Direction::Clientbound;
1276}
1277impl From<Collect> for ClientboundPlayPacket {
1278    fn from(p: Collect) -> Self {
1279        Self::Collect(p)
1280    }
1281}
1282
1283/// `entity_teleport` (clientbound play, id 0x4c).
1284pub type EntityTeleport = crate::defs::p340::play::clientbound::EntityTeleport<340>;
1285impl crate::packet::Packet for EntityTeleport {
1286    const ID: i32 = id::ENTITY_TELEPORT;
1287    const NAME: &'static str = "entity_teleport";
1288    const STATE: State = State::Play;
1289    const DIRECTION: Direction = Direction::Clientbound;
1290}
1291impl From<EntityTeleport> for ClientboundPlayPacket {
1292    fn from(p: EntityTeleport) -> Self {
1293        Self::EntityTeleport(p)
1294    }
1295}
1296
1297/// `advancements` (clientbound play, id 0x4d).
1298pub type Advancements = crate::defs::p340::play::clientbound::Advancements<340>;
1299impl crate::packet::Packet for Advancements {
1300    const ID: i32 = id::ADVANCEMENTS;
1301    const NAME: &'static str = "advancements";
1302    const STATE: State = State::Play;
1303    const DIRECTION: Direction = Direction::Clientbound;
1304}
1305impl From<Advancements> for ClientboundPlayPacket {
1306    fn from(p: Advancements) -> Self {
1307        Self::Advancements(p)
1308    }
1309}
1310
1311/// `entity_update_attributes` (clientbound play, id 0x4e).
1312pub type EntityUpdateAttributes = crate::defs::p340::play::clientbound::EntityUpdateAttributes<340>;
1313impl crate::packet::Packet for EntityUpdateAttributes {
1314    const ID: i32 = id::ENTITY_UPDATE_ATTRIBUTES;
1315    const NAME: &'static str = "entity_update_attributes";
1316    const STATE: State = State::Play;
1317    const DIRECTION: Direction = Direction::Clientbound;
1318}
1319impl From<EntityUpdateAttributes> for ClientboundPlayPacket {
1320    fn from(p: EntityUpdateAttributes) -> Self {
1321        Self::EntityUpdateAttributes(p)
1322    }
1323}
1324
1325/// `entity_effect` (clientbound play, id 0x4f).
1326pub type EntityEffect = crate::defs::p340::play::clientbound::EntityEffect<340>;
1327impl crate::packet::Packet for EntityEffect {
1328    const ID: i32 = id::ENTITY_EFFECT;
1329    const NAME: &'static str = "entity_effect";
1330    const STATE: State = State::Play;
1331    const DIRECTION: Direction = Direction::Clientbound;
1332}
1333impl From<EntityEffect> for ClientboundPlayPacket {
1334    fn from(p: EntityEffect) -> Self {
1335        Self::EntityEffect(p)
1336    }
1337}
1338
1339/// Every Clientbound packet of the Play state.
1340#[derive(Debug, Clone, PartialEq)]
1341pub enum ClientboundPlayPacket {
1342    /// `spawn_entity`
1343    SpawnEntity(SpawnEntity),
1344    /// `spawn_entity_experience_orb`
1345    SpawnEntityExperienceOrb(SpawnEntityExperienceOrb),
1346    /// `spawn_entity_weather`
1347    SpawnEntityWeather(SpawnEntityWeather),
1348    /// `spawn_entity_living`
1349    SpawnEntityLiving(SpawnEntityLiving),
1350    /// `spawn_entity_painting`
1351    SpawnEntityPainting(SpawnEntityPainting),
1352    /// `named_entity_spawn`
1353    NamedEntitySpawn(NamedEntitySpawn),
1354    /// `animation`
1355    Animation(Animation),
1356    /// `statistics`
1357    Statistics(Statistics),
1358    /// `block_break_animation`
1359    BlockBreakAnimation(BlockBreakAnimation),
1360    /// `tile_entity_data`
1361    TileEntityData(TileEntityData),
1362    /// `block_action`
1363    BlockAction(BlockAction),
1364    /// `block_change`
1365    BlockChange(BlockChange),
1366    /// `boss_bar`
1367    BossBar(BossBar),
1368    /// `difficulty`
1369    Difficulty(Difficulty),
1370    /// `tab_complete`
1371    TabComplete(TabComplete),
1372    /// `chat`
1373    Chat(Chat),
1374    /// `multi_block_change`
1375    MultiBlockChange(MultiBlockChange),
1376    /// `transaction`
1377    Transaction(Transaction),
1378    /// `close_window`
1379    CloseWindow(CloseWindow),
1380    /// `open_window`
1381    OpenWindow(OpenWindow),
1382    /// `window_items`
1383    WindowItems(WindowItems),
1384    /// `craft_progress_bar`
1385    CraftProgressBar(CraftProgressBar),
1386    /// `set_slot`
1387    SetSlot(SetSlot),
1388    /// `set_cooldown`
1389    SetCooldown(SetCooldown),
1390    /// `custom_payload`
1391    CustomPayload(CustomPayload),
1392    /// `named_sound_effect`
1393    NamedSoundEffect(NamedSoundEffect),
1394    /// `kick_disconnect`
1395    KickDisconnect(KickDisconnect),
1396    /// `entity_status`
1397    EntityStatus(EntityStatus),
1398    /// `explosion`
1399    Explosion(Explosion),
1400    /// `unload_chunk`
1401    UnloadChunk(UnloadChunk),
1402    /// `game_state_change`
1403    GameStateChange(GameStateChange),
1404    /// `keep_alive`
1405    KeepAlive(KeepAlive),
1406    /// `map_chunk`
1407    MapChunk(MapChunk),
1408    /// `world_event`
1409    WorldEvent(WorldEvent),
1410    /// `world_particles`
1411    WorldParticles(WorldParticles),
1412    /// `login`
1413    Login(Login),
1414    /// `map`
1415    Map(Map),
1416    /// `entity`
1417    Entity(Entity),
1418    /// `rel_entity_move`
1419    RelEntityMove(RelEntityMove),
1420    /// `entity_move_look`
1421    EntityMoveLook(EntityMoveLook),
1422    /// `entity_look`
1423    EntityLook(EntityLook),
1424    /// `vehicle_move`
1425    VehicleMove(VehicleMove),
1426    /// `open_sign_entity`
1427    OpenSignEntity(OpenSignEntity),
1428    /// `craft_recipe_response`
1429    CraftRecipeResponse(CraftRecipeResponse),
1430    /// `abilities`
1431    Abilities(Abilities),
1432    /// `combat_event`
1433    CombatEvent(CombatEvent),
1434    /// `player_info`
1435    PlayerInfo(PlayerInfo),
1436    /// `position`
1437    Position(Position),
1438    /// `bed`
1439    Bed(Bed),
1440    /// `unlock_recipes`
1441    UnlockRecipes(UnlockRecipes),
1442    /// `entity_destroy`
1443    EntityDestroy(EntityDestroy),
1444    /// `remove_entity_effect`
1445    RemoveEntityEffect(RemoveEntityEffect),
1446    /// `resource_pack_send`
1447    ResourcePackSend(ResourcePackSend),
1448    /// `respawn`
1449    Respawn(Respawn),
1450    /// `entity_head_rotation`
1451    EntityHeadRotation(EntityHeadRotation),
1452    /// `select_advancement_tab`
1453    SelectAdvancementTab(SelectAdvancementTab),
1454    /// `world_border`
1455    WorldBorder(WorldBorder),
1456    /// `camera`
1457    Camera(Camera),
1458    /// `held_item_slot`
1459    HeldItemSlot(HeldItemSlot),
1460    /// `scoreboard_display_objective`
1461    ScoreboardDisplayObjective(ScoreboardDisplayObjective),
1462    /// `entity_metadata`
1463    EntityMetadata(EntityMetadata),
1464    /// `attach_entity`
1465    AttachEntity(AttachEntity),
1466    /// `entity_velocity`
1467    EntityVelocity(EntityVelocity),
1468    /// `entity_equipment`
1469    EntityEquipment(EntityEquipment),
1470    /// `experience`
1471    Experience(Experience),
1472    /// `update_health`
1473    UpdateHealth(UpdateHealth),
1474    /// `scoreboard_objective`
1475    ScoreboardObjective(ScoreboardObjective),
1476    /// `set_passengers`
1477    SetPassengers(SetPassengers),
1478    /// `teams`
1479    Teams(Teams),
1480    /// `scoreboard_score`
1481    ScoreboardScore(ScoreboardScore),
1482    /// `spawn_position`
1483    SpawnPosition(SpawnPosition),
1484    /// `update_time`
1485    UpdateTime(UpdateTime),
1486    /// `title`
1487    Title(Title),
1488    /// `sound_effect`
1489    SoundEffect(SoundEffect),
1490    /// `playerlist_header`
1491    PlayerlistHeader(PlayerlistHeader),
1492    /// `collect`
1493    Collect(Collect),
1494    /// `entity_teleport`
1495    EntityTeleport(EntityTeleport),
1496    /// `advancements`
1497    Advancements(Advancements),
1498    /// `entity_update_attributes`
1499    EntityUpdateAttributes(EntityUpdateAttributes),
1500    /// `entity_effect`
1501    EntityEffect(EntityEffect),
1502}
1503
1504impl PacketSet for ClientboundPlayPacket {
1505    const STATE: State = State::Play;
1506    const DIRECTION: Direction = Direction::Clientbound;
1507    fn decode_raw(raw: &RawPacket) -> DecodeResult<Self> {
1508        match raw.id {
1509            id::SPAWN_ENTITY => decode_exact(&raw.body).map(Self::SpawnEntity),
1510            id::SPAWN_ENTITY_EXPERIENCE_ORB => {
1511                decode_exact(&raw.body).map(Self::SpawnEntityExperienceOrb)
1512            }
1513            id::SPAWN_ENTITY_WEATHER => decode_exact(&raw.body).map(Self::SpawnEntityWeather),
1514            id::SPAWN_ENTITY_LIVING => decode_exact(&raw.body).map(Self::SpawnEntityLiving),
1515            id::SPAWN_ENTITY_PAINTING => decode_exact(&raw.body).map(Self::SpawnEntityPainting),
1516            id::NAMED_ENTITY_SPAWN => decode_exact(&raw.body).map(Self::NamedEntitySpawn),
1517            id::ANIMATION => decode_exact(&raw.body).map(Self::Animation),
1518            id::STATISTICS => decode_exact(&raw.body).map(Self::Statistics),
1519            id::BLOCK_BREAK_ANIMATION => decode_exact(&raw.body).map(Self::BlockBreakAnimation),
1520            id::TILE_ENTITY_DATA => decode_exact(&raw.body).map(Self::TileEntityData),
1521            id::BLOCK_ACTION => decode_exact(&raw.body).map(Self::BlockAction),
1522            id::BLOCK_CHANGE => decode_exact(&raw.body).map(Self::BlockChange),
1523            id::BOSS_BAR => decode_exact(&raw.body).map(Self::BossBar),
1524            id::DIFFICULTY => decode_exact(&raw.body).map(Self::Difficulty),
1525            id::TAB_COMPLETE => decode_exact(&raw.body).map(Self::TabComplete),
1526            id::CHAT => decode_exact(&raw.body).map(Self::Chat),
1527            id::MULTI_BLOCK_CHANGE => decode_exact(&raw.body).map(Self::MultiBlockChange),
1528            id::TRANSACTION => decode_exact(&raw.body).map(Self::Transaction),
1529            id::CLOSE_WINDOW => decode_exact(&raw.body).map(Self::CloseWindow),
1530            id::OPEN_WINDOW => decode_exact(&raw.body).map(Self::OpenWindow),
1531            id::WINDOW_ITEMS => decode_exact(&raw.body).map(Self::WindowItems),
1532            id::CRAFT_PROGRESS_BAR => decode_exact(&raw.body).map(Self::CraftProgressBar),
1533            id::SET_SLOT => decode_exact(&raw.body).map(Self::SetSlot),
1534            id::SET_COOLDOWN => decode_exact(&raw.body).map(Self::SetCooldown),
1535            id::CUSTOM_PAYLOAD => decode_exact(&raw.body).map(Self::CustomPayload),
1536            id::NAMED_SOUND_EFFECT => decode_exact(&raw.body).map(Self::NamedSoundEffect),
1537            id::KICK_DISCONNECT => decode_exact(&raw.body).map(Self::KickDisconnect),
1538            id::ENTITY_STATUS => decode_exact(&raw.body).map(Self::EntityStatus),
1539            id::EXPLOSION => decode_exact(&raw.body).map(Self::Explosion),
1540            id::UNLOAD_CHUNK => decode_exact(&raw.body).map(Self::UnloadChunk),
1541            id::GAME_STATE_CHANGE => decode_exact(&raw.body).map(Self::GameStateChange),
1542            id::KEEP_ALIVE => decode_exact(&raw.body).map(Self::KeepAlive),
1543            id::MAP_CHUNK => decode_exact(&raw.body).map(Self::MapChunk),
1544            id::WORLD_EVENT => decode_exact(&raw.body).map(Self::WorldEvent),
1545            id::WORLD_PARTICLES => decode_exact(&raw.body).map(Self::WorldParticles),
1546            id::LOGIN => decode_exact(&raw.body).map(Self::Login),
1547            id::MAP => decode_exact(&raw.body).map(Self::Map),
1548            id::ENTITY => decode_exact(&raw.body).map(Self::Entity),
1549            id::REL_ENTITY_MOVE => decode_exact(&raw.body).map(Self::RelEntityMove),
1550            id::ENTITY_MOVE_LOOK => decode_exact(&raw.body).map(Self::EntityMoveLook),
1551            id::ENTITY_LOOK => decode_exact(&raw.body).map(Self::EntityLook),
1552            id::VEHICLE_MOVE => decode_exact(&raw.body).map(Self::VehicleMove),
1553            id::OPEN_SIGN_ENTITY => decode_exact(&raw.body).map(Self::OpenSignEntity),
1554            id::CRAFT_RECIPE_RESPONSE => decode_exact(&raw.body).map(Self::CraftRecipeResponse),
1555            id::ABILITIES => decode_exact(&raw.body).map(Self::Abilities),
1556            id::COMBAT_EVENT => decode_exact(&raw.body).map(Self::CombatEvent),
1557            id::PLAYER_INFO => decode_exact(&raw.body).map(Self::PlayerInfo),
1558            id::POSITION => decode_exact(&raw.body).map(Self::Position),
1559            id::BED => decode_exact(&raw.body).map(Self::Bed),
1560            id::UNLOCK_RECIPES => decode_exact(&raw.body).map(Self::UnlockRecipes),
1561            id::ENTITY_DESTROY => decode_exact(&raw.body).map(Self::EntityDestroy),
1562            id::REMOVE_ENTITY_EFFECT => decode_exact(&raw.body).map(Self::RemoveEntityEffect),
1563            id::RESOURCE_PACK_SEND => decode_exact(&raw.body).map(Self::ResourcePackSend),
1564            id::RESPAWN => decode_exact(&raw.body).map(Self::Respawn),
1565            id::ENTITY_HEAD_ROTATION => decode_exact(&raw.body).map(Self::EntityHeadRotation),
1566            id::SELECT_ADVANCEMENT_TAB => decode_exact(&raw.body).map(Self::SelectAdvancementTab),
1567            id::WORLD_BORDER => decode_exact(&raw.body).map(Self::WorldBorder),
1568            id::CAMERA => decode_exact(&raw.body).map(Self::Camera),
1569            id::HELD_ITEM_SLOT => decode_exact(&raw.body).map(Self::HeldItemSlot),
1570            id::SCOREBOARD_DISPLAY_OBJECTIVE => {
1571                decode_exact(&raw.body).map(Self::ScoreboardDisplayObjective)
1572            }
1573            id::ENTITY_METADATA => decode_exact(&raw.body).map(Self::EntityMetadata),
1574            id::ATTACH_ENTITY => decode_exact(&raw.body).map(Self::AttachEntity),
1575            id::ENTITY_VELOCITY => decode_exact(&raw.body).map(Self::EntityVelocity),
1576            id::ENTITY_EQUIPMENT => decode_exact(&raw.body).map(Self::EntityEquipment),
1577            id::EXPERIENCE => decode_exact(&raw.body).map(Self::Experience),
1578            id::UPDATE_HEALTH => decode_exact(&raw.body).map(Self::UpdateHealth),
1579            id::SCOREBOARD_OBJECTIVE => decode_exact(&raw.body).map(Self::ScoreboardObjective),
1580            id::SET_PASSENGERS => decode_exact(&raw.body).map(Self::SetPassengers),
1581            id::TEAMS => decode_exact(&raw.body).map(Self::Teams),
1582            id::SCOREBOARD_SCORE => decode_exact(&raw.body).map(Self::ScoreboardScore),
1583            id::SPAWN_POSITION => decode_exact(&raw.body).map(Self::SpawnPosition),
1584            id::UPDATE_TIME => decode_exact(&raw.body).map(Self::UpdateTime),
1585            id::TITLE => decode_exact(&raw.body).map(Self::Title),
1586            id::SOUND_EFFECT => decode_exact(&raw.body).map(Self::SoundEffect),
1587            id::PLAYERLIST_HEADER => decode_exact(&raw.body).map(Self::PlayerlistHeader),
1588            id::COLLECT => decode_exact(&raw.body).map(Self::Collect),
1589            id::ENTITY_TELEPORT => decode_exact(&raw.body).map(Self::EntityTeleport),
1590            id::ADVANCEMENTS => decode_exact(&raw.body).map(Self::Advancements),
1591            id::ENTITY_UPDATE_ATTRIBUTES => {
1592                decode_exact(&raw.body).map(Self::EntityUpdateAttributes)
1593            }
1594            id::ENTITY_EFFECT => decode_exact(&raw.body).map(Self::EntityEffect),
1595            other => Err(DecodeError::UnknownPacketId(other)),
1596        }
1597    }
1598    fn id(&self) -> i32 {
1599        match *self {
1600            Self::SpawnEntity(_) => id::SPAWN_ENTITY,
1601            Self::SpawnEntityExperienceOrb(_) => id::SPAWN_ENTITY_EXPERIENCE_ORB,
1602            Self::SpawnEntityWeather(_) => id::SPAWN_ENTITY_WEATHER,
1603            Self::SpawnEntityLiving(_) => id::SPAWN_ENTITY_LIVING,
1604            Self::SpawnEntityPainting(_) => id::SPAWN_ENTITY_PAINTING,
1605            Self::NamedEntitySpawn(_) => id::NAMED_ENTITY_SPAWN,
1606            Self::Animation(_) => id::ANIMATION,
1607            Self::Statistics(_) => id::STATISTICS,
1608            Self::BlockBreakAnimation(_) => id::BLOCK_BREAK_ANIMATION,
1609            Self::TileEntityData(_) => id::TILE_ENTITY_DATA,
1610            Self::BlockAction(_) => id::BLOCK_ACTION,
1611            Self::BlockChange(_) => id::BLOCK_CHANGE,
1612            Self::BossBar(_) => id::BOSS_BAR,
1613            Self::Difficulty(_) => id::DIFFICULTY,
1614            Self::TabComplete(_) => id::TAB_COMPLETE,
1615            Self::Chat(_) => id::CHAT,
1616            Self::MultiBlockChange(_) => id::MULTI_BLOCK_CHANGE,
1617            Self::Transaction(_) => id::TRANSACTION,
1618            Self::CloseWindow(_) => id::CLOSE_WINDOW,
1619            Self::OpenWindow(_) => id::OPEN_WINDOW,
1620            Self::WindowItems(_) => id::WINDOW_ITEMS,
1621            Self::CraftProgressBar(_) => id::CRAFT_PROGRESS_BAR,
1622            Self::SetSlot(_) => id::SET_SLOT,
1623            Self::SetCooldown(_) => id::SET_COOLDOWN,
1624            Self::CustomPayload(_) => id::CUSTOM_PAYLOAD,
1625            Self::NamedSoundEffect(_) => id::NAMED_SOUND_EFFECT,
1626            Self::KickDisconnect(_) => id::KICK_DISCONNECT,
1627            Self::EntityStatus(_) => id::ENTITY_STATUS,
1628            Self::Explosion(_) => id::EXPLOSION,
1629            Self::UnloadChunk(_) => id::UNLOAD_CHUNK,
1630            Self::GameStateChange(_) => id::GAME_STATE_CHANGE,
1631            Self::KeepAlive(_) => id::KEEP_ALIVE,
1632            Self::MapChunk(_) => id::MAP_CHUNK,
1633            Self::WorldEvent(_) => id::WORLD_EVENT,
1634            Self::WorldParticles(_) => id::WORLD_PARTICLES,
1635            Self::Login(_) => id::LOGIN,
1636            Self::Map(_) => id::MAP,
1637            Self::Entity(_) => id::ENTITY,
1638            Self::RelEntityMove(_) => id::REL_ENTITY_MOVE,
1639            Self::EntityMoveLook(_) => id::ENTITY_MOVE_LOOK,
1640            Self::EntityLook(_) => id::ENTITY_LOOK,
1641            Self::VehicleMove(_) => id::VEHICLE_MOVE,
1642            Self::OpenSignEntity(_) => id::OPEN_SIGN_ENTITY,
1643            Self::CraftRecipeResponse(_) => id::CRAFT_RECIPE_RESPONSE,
1644            Self::Abilities(_) => id::ABILITIES,
1645            Self::CombatEvent(_) => id::COMBAT_EVENT,
1646            Self::PlayerInfo(_) => id::PLAYER_INFO,
1647            Self::Position(_) => id::POSITION,
1648            Self::Bed(_) => id::BED,
1649            Self::UnlockRecipes(_) => id::UNLOCK_RECIPES,
1650            Self::EntityDestroy(_) => id::ENTITY_DESTROY,
1651            Self::RemoveEntityEffect(_) => id::REMOVE_ENTITY_EFFECT,
1652            Self::ResourcePackSend(_) => id::RESOURCE_PACK_SEND,
1653            Self::Respawn(_) => id::RESPAWN,
1654            Self::EntityHeadRotation(_) => id::ENTITY_HEAD_ROTATION,
1655            Self::SelectAdvancementTab(_) => id::SELECT_ADVANCEMENT_TAB,
1656            Self::WorldBorder(_) => id::WORLD_BORDER,
1657            Self::Camera(_) => id::CAMERA,
1658            Self::HeldItemSlot(_) => id::HELD_ITEM_SLOT,
1659            Self::ScoreboardDisplayObjective(_) => id::SCOREBOARD_DISPLAY_OBJECTIVE,
1660            Self::EntityMetadata(_) => id::ENTITY_METADATA,
1661            Self::AttachEntity(_) => id::ATTACH_ENTITY,
1662            Self::EntityVelocity(_) => id::ENTITY_VELOCITY,
1663            Self::EntityEquipment(_) => id::ENTITY_EQUIPMENT,
1664            Self::Experience(_) => id::EXPERIENCE,
1665            Self::UpdateHealth(_) => id::UPDATE_HEALTH,
1666            Self::ScoreboardObjective(_) => id::SCOREBOARD_OBJECTIVE,
1667            Self::SetPassengers(_) => id::SET_PASSENGERS,
1668            Self::Teams(_) => id::TEAMS,
1669            Self::ScoreboardScore(_) => id::SCOREBOARD_SCORE,
1670            Self::SpawnPosition(_) => id::SPAWN_POSITION,
1671            Self::UpdateTime(_) => id::UPDATE_TIME,
1672            Self::Title(_) => id::TITLE,
1673            Self::SoundEffect(_) => id::SOUND_EFFECT,
1674            Self::PlayerlistHeader(_) => id::PLAYERLIST_HEADER,
1675            Self::Collect(_) => id::COLLECT,
1676            Self::EntityTeleport(_) => id::ENTITY_TELEPORT,
1677            Self::Advancements(_) => id::ADVANCEMENTS,
1678            Self::EntityUpdateAttributes(_) => id::ENTITY_UPDATE_ATTRIBUTES,
1679            Self::EntityEffect(_) => id::ENTITY_EFFECT,
1680        }
1681    }
1682    fn name(&self) -> &'static str {
1683        match *self {
1684            Self::SpawnEntity(_) => "spawn_entity",
1685            Self::SpawnEntityExperienceOrb(_) => "spawn_entity_experience_orb",
1686            Self::SpawnEntityWeather(_) => "spawn_entity_weather",
1687            Self::SpawnEntityLiving(_) => "spawn_entity_living",
1688            Self::SpawnEntityPainting(_) => "spawn_entity_painting",
1689            Self::NamedEntitySpawn(_) => "named_entity_spawn",
1690            Self::Animation(_) => "animation",
1691            Self::Statistics(_) => "statistics",
1692            Self::BlockBreakAnimation(_) => "block_break_animation",
1693            Self::TileEntityData(_) => "tile_entity_data",
1694            Self::BlockAction(_) => "block_action",
1695            Self::BlockChange(_) => "block_change",
1696            Self::BossBar(_) => "boss_bar",
1697            Self::Difficulty(_) => "difficulty",
1698            Self::TabComplete(_) => "tab_complete",
1699            Self::Chat(_) => "chat",
1700            Self::MultiBlockChange(_) => "multi_block_change",
1701            Self::Transaction(_) => "transaction",
1702            Self::CloseWindow(_) => "close_window",
1703            Self::OpenWindow(_) => "open_window",
1704            Self::WindowItems(_) => "window_items",
1705            Self::CraftProgressBar(_) => "craft_progress_bar",
1706            Self::SetSlot(_) => "set_slot",
1707            Self::SetCooldown(_) => "set_cooldown",
1708            Self::CustomPayload(_) => "custom_payload",
1709            Self::NamedSoundEffect(_) => "named_sound_effect",
1710            Self::KickDisconnect(_) => "kick_disconnect",
1711            Self::EntityStatus(_) => "entity_status",
1712            Self::Explosion(_) => "explosion",
1713            Self::UnloadChunk(_) => "unload_chunk",
1714            Self::GameStateChange(_) => "game_state_change",
1715            Self::KeepAlive(_) => "keep_alive",
1716            Self::MapChunk(_) => "map_chunk",
1717            Self::WorldEvent(_) => "world_event",
1718            Self::WorldParticles(_) => "world_particles",
1719            Self::Login(_) => "login",
1720            Self::Map(_) => "map",
1721            Self::Entity(_) => "entity",
1722            Self::RelEntityMove(_) => "rel_entity_move",
1723            Self::EntityMoveLook(_) => "entity_move_look",
1724            Self::EntityLook(_) => "entity_look",
1725            Self::VehicleMove(_) => "vehicle_move",
1726            Self::OpenSignEntity(_) => "open_sign_entity",
1727            Self::CraftRecipeResponse(_) => "craft_recipe_response",
1728            Self::Abilities(_) => "abilities",
1729            Self::CombatEvent(_) => "combat_event",
1730            Self::PlayerInfo(_) => "player_info",
1731            Self::Position(_) => "position",
1732            Self::Bed(_) => "bed",
1733            Self::UnlockRecipes(_) => "unlock_recipes",
1734            Self::EntityDestroy(_) => "entity_destroy",
1735            Self::RemoveEntityEffect(_) => "remove_entity_effect",
1736            Self::ResourcePackSend(_) => "resource_pack_send",
1737            Self::Respawn(_) => "respawn",
1738            Self::EntityHeadRotation(_) => "entity_head_rotation",
1739            Self::SelectAdvancementTab(_) => "select_advancement_tab",
1740            Self::WorldBorder(_) => "world_border",
1741            Self::Camera(_) => "camera",
1742            Self::HeldItemSlot(_) => "held_item_slot",
1743            Self::ScoreboardDisplayObjective(_) => "scoreboard_display_objective",
1744            Self::EntityMetadata(_) => "entity_metadata",
1745            Self::AttachEntity(_) => "attach_entity",
1746            Self::EntityVelocity(_) => "entity_velocity",
1747            Self::EntityEquipment(_) => "entity_equipment",
1748            Self::Experience(_) => "experience",
1749            Self::UpdateHealth(_) => "update_health",
1750            Self::ScoreboardObjective(_) => "scoreboard_objective",
1751            Self::SetPassengers(_) => "set_passengers",
1752            Self::Teams(_) => "teams",
1753            Self::ScoreboardScore(_) => "scoreboard_score",
1754            Self::SpawnPosition(_) => "spawn_position",
1755            Self::UpdateTime(_) => "update_time",
1756            Self::Title(_) => "title",
1757            Self::SoundEffect(_) => "sound_effect",
1758            Self::PlayerlistHeader(_) => "playerlist_header",
1759            Self::Collect(_) => "collect",
1760            Self::EntityTeleport(_) => "entity_teleport",
1761            Self::Advancements(_) => "advancements",
1762            Self::EntityUpdateAttributes(_) => "entity_update_attributes",
1763            Self::EntityEffect(_) => "entity_effect",
1764        }
1765    }
1766    fn encode_body(&self, w: &mut BytesMut) -> EncodeResult {
1767        match *self {
1768            Self::SpawnEntity(ref p) => p.encode(w),
1769            Self::SpawnEntityExperienceOrb(ref p) => p.encode(w),
1770            Self::SpawnEntityWeather(ref p) => p.encode(w),
1771            Self::SpawnEntityLiving(ref p) => p.encode(w),
1772            Self::SpawnEntityPainting(ref p) => p.encode(w),
1773            Self::NamedEntitySpawn(ref p) => p.encode(w),
1774            Self::Animation(ref p) => p.encode(w),
1775            Self::Statistics(ref p) => p.encode(w),
1776            Self::BlockBreakAnimation(ref p) => p.encode(w),
1777            Self::TileEntityData(ref p) => p.encode(w),
1778            Self::BlockAction(ref p) => p.encode(w),
1779            Self::BlockChange(ref p) => p.encode(w),
1780            Self::BossBar(ref p) => p.encode(w),
1781            Self::Difficulty(ref p) => p.encode(w),
1782            Self::TabComplete(ref p) => p.encode(w),
1783            Self::Chat(ref p) => p.encode(w),
1784            Self::MultiBlockChange(ref p) => p.encode(w),
1785            Self::Transaction(ref p) => p.encode(w),
1786            Self::CloseWindow(ref p) => p.encode(w),
1787            Self::OpenWindow(ref p) => p.encode(w),
1788            Self::WindowItems(ref p) => p.encode(w),
1789            Self::CraftProgressBar(ref p) => p.encode(w),
1790            Self::SetSlot(ref p) => p.encode(w),
1791            Self::SetCooldown(ref p) => p.encode(w),
1792            Self::CustomPayload(ref p) => p.encode(w),
1793            Self::NamedSoundEffect(ref p) => p.encode(w),
1794            Self::KickDisconnect(ref p) => p.encode(w),
1795            Self::EntityStatus(ref p) => p.encode(w),
1796            Self::Explosion(ref p) => p.encode(w),
1797            Self::UnloadChunk(ref p) => p.encode(w),
1798            Self::GameStateChange(ref p) => p.encode(w),
1799            Self::KeepAlive(ref p) => p.encode(w),
1800            Self::MapChunk(ref p) => p.encode(w),
1801            Self::WorldEvent(ref p) => p.encode(w),
1802            Self::WorldParticles(ref p) => p.encode(w),
1803            Self::Login(ref p) => p.encode(w),
1804            Self::Map(ref p) => p.encode(w),
1805            Self::Entity(ref p) => p.encode(w),
1806            Self::RelEntityMove(ref p) => p.encode(w),
1807            Self::EntityMoveLook(ref p) => p.encode(w),
1808            Self::EntityLook(ref p) => p.encode(w),
1809            Self::VehicleMove(ref p) => p.encode(w),
1810            Self::OpenSignEntity(ref p) => p.encode(w),
1811            Self::CraftRecipeResponse(ref p) => p.encode(w),
1812            Self::Abilities(ref p) => p.encode(w),
1813            Self::CombatEvent(ref p) => p.encode(w),
1814            Self::PlayerInfo(ref p) => p.encode(w),
1815            Self::Position(ref p) => p.encode(w),
1816            Self::Bed(ref p) => p.encode(w),
1817            Self::UnlockRecipes(ref p) => p.encode(w),
1818            Self::EntityDestroy(ref p) => p.encode(w),
1819            Self::RemoveEntityEffect(ref p) => p.encode(w),
1820            Self::ResourcePackSend(ref p) => p.encode(w),
1821            Self::Respawn(ref p) => p.encode(w),
1822            Self::EntityHeadRotation(ref p) => p.encode(w),
1823            Self::SelectAdvancementTab(ref p) => p.encode(w),
1824            Self::WorldBorder(ref p) => p.encode(w),
1825            Self::Camera(ref p) => p.encode(w),
1826            Self::HeldItemSlot(ref p) => p.encode(w),
1827            Self::ScoreboardDisplayObjective(ref p) => p.encode(w),
1828            Self::EntityMetadata(ref p) => p.encode(w),
1829            Self::AttachEntity(ref p) => p.encode(w),
1830            Self::EntityVelocity(ref p) => p.encode(w),
1831            Self::EntityEquipment(ref p) => p.encode(w),
1832            Self::Experience(ref p) => p.encode(w),
1833            Self::UpdateHealth(ref p) => p.encode(w),
1834            Self::ScoreboardObjective(ref p) => p.encode(w),
1835            Self::SetPassengers(ref p) => p.encode(w),
1836            Self::Teams(ref p) => p.encode(w),
1837            Self::ScoreboardScore(ref p) => p.encode(w),
1838            Self::SpawnPosition(ref p) => p.encode(w),
1839            Self::UpdateTime(ref p) => p.encode(w),
1840            Self::Title(ref p) => p.encode(w),
1841            Self::SoundEffect(ref p) => p.encode(w),
1842            Self::PlayerlistHeader(ref p) => p.encode(w),
1843            Self::Collect(ref p) => p.encode(w),
1844            Self::EntityTeleport(ref p) => p.encode(w),
1845            Self::Advancements(ref p) => p.encode(w),
1846            Self::EntityUpdateAttributes(ref p) => p.encode(w),
1847            Self::EntityEffect(ref p) => p.encode(w),
1848        }
1849    }
1850    fn name_of(id: i32) -> Option<&'static str> {
1851        match id {
1852            id::SPAWN_ENTITY => Some("spawn_entity"),
1853            id::SPAWN_ENTITY_EXPERIENCE_ORB => Some("spawn_entity_experience_orb"),
1854            id::SPAWN_ENTITY_WEATHER => Some("spawn_entity_weather"),
1855            id::SPAWN_ENTITY_LIVING => Some("spawn_entity_living"),
1856            id::SPAWN_ENTITY_PAINTING => Some("spawn_entity_painting"),
1857            id::NAMED_ENTITY_SPAWN => Some("named_entity_spawn"),
1858            id::ANIMATION => Some("animation"),
1859            id::STATISTICS => Some("statistics"),
1860            id::BLOCK_BREAK_ANIMATION => Some("block_break_animation"),
1861            id::TILE_ENTITY_DATA => Some("tile_entity_data"),
1862            id::BLOCK_ACTION => Some("block_action"),
1863            id::BLOCK_CHANGE => Some("block_change"),
1864            id::BOSS_BAR => Some("boss_bar"),
1865            id::DIFFICULTY => Some("difficulty"),
1866            id::TAB_COMPLETE => Some("tab_complete"),
1867            id::CHAT => Some("chat"),
1868            id::MULTI_BLOCK_CHANGE => Some("multi_block_change"),
1869            id::TRANSACTION => Some("transaction"),
1870            id::CLOSE_WINDOW => Some("close_window"),
1871            id::OPEN_WINDOW => Some("open_window"),
1872            id::WINDOW_ITEMS => Some("window_items"),
1873            id::CRAFT_PROGRESS_BAR => Some("craft_progress_bar"),
1874            id::SET_SLOT => Some("set_slot"),
1875            id::SET_COOLDOWN => Some("set_cooldown"),
1876            id::CUSTOM_PAYLOAD => Some("custom_payload"),
1877            id::NAMED_SOUND_EFFECT => Some("named_sound_effect"),
1878            id::KICK_DISCONNECT => Some("kick_disconnect"),
1879            id::ENTITY_STATUS => Some("entity_status"),
1880            id::EXPLOSION => Some("explosion"),
1881            id::UNLOAD_CHUNK => Some("unload_chunk"),
1882            id::GAME_STATE_CHANGE => Some("game_state_change"),
1883            id::KEEP_ALIVE => Some("keep_alive"),
1884            id::MAP_CHUNK => Some("map_chunk"),
1885            id::WORLD_EVENT => Some("world_event"),
1886            id::WORLD_PARTICLES => Some("world_particles"),
1887            id::LOGIN => Some("login"),
1888            id::MAP => Some("map"),
1889            id::ENTITY => Some("entity"),
1890            id::REL_ENTITY_MOVE => Some("rel_entity_move"),
1891            id::ENTITY_MOVE_LOOK => Some("entity_move_look"),
1892            id::ENTITY_LOOK => Some("entity_look"),
1893            id::VEHICLE_MOVE => Some("vehicle_move"),
1894            id::OPEN_SIGN_ENTITY => Some("open_sign_entity"),
1895            id::CRAFT_RECIPE_RESPONSE => Some("craft_recipe_response"),
1896            id::ABILITIES => Some("abilities"),
1897            id::COMBAT_EVENT => Some("combat_event"),
1898            id::PLAYER_INFO => Some("player_info"),
1899            id::POSITION => Some("position"),
1900            id::BED => Some("bed"),
1901            id::UNLOCK_RECIPES => Some("unlock_recipes"),
1902            id::ENTITY_DESTROY => Some("entity_destroy"),
1903            id::REMOVE_ENTITY_EFFECT => Some("remove_entity_effect"),
1904            id::RESOURCE_PACK_SEND => Some("resource_pack_send"),
1905            id::RESPAWN => Some("respawn"),
1906            id::ENTITY_HEAD_ROTATION => Some("entity_head_rotation"),
1907            id::SELECT_ADVANCEMENT_TAB => Some("select_advancement_tab"),
1908            id::WORLD_BORDER => Some("world_border"),
1909            id::CAMERA => Some("camera"),
1910            id::HELD_ITEM_SLOT => Some("held_item_slot"),
1911            id::SCOREBOARD_DISPLAY_OBJECTIVE => Some("scoreboard_display_objective"),
1912            id::ENTITY_METADATA => Some("entity_metadata"),
1913            id::ATTACH_ENTITY => Some("attach_entity"),
1914            id::ENTITY_VELOCITY => Some("entity_velocity"),
1915            id::ENTITY_EQUIPMENT => Some("entity_equipment"),
1916            id::EXPERIENCE => Some("experience"),
1917            id::UPDATE_HEALTH => Some("update_health"),
1918            id::SCOREBOARD_OBJECTIVE => Some("scoreboard_objective"),
1919            id::SET_PASSENGERS => Some("set_passengers"),
1920            id::TEAMS => Some("teams"),
1921            id::SCOREBOARD_SCORE => Some("scoreboard_score"),
1922            id::SPAWN_POSITION => Some("spawn_position"),
1923            id::UPDATE_TIME => Some("update_time"),
1924            id::TITLE => Some("title"),
1925            id::SOUND_EFFECT => Some("sound_effect"),
1926            id::PLAYERLIST_HEADER => Some("playerlist_header"),
1927            id::COLLECT => Some("collect"),
1928            id::ENTITY_TELEPORT => Some("entity_teleport"),
1929            id::ADVANCEMENTS => Some("advancements"),
1930            id::ENTITY_UPDATE_ATTRIBUTES => Some("entity_update_attributes"),
1931            id::ENTITY_EFFECT => Some("entity_effect"),
1932            _ => None,
1933        }
1934    }
1935}
1936
1937impl ClientboundPlayPacket {
1938    /// All packet ids of this set, ascending.
1939    pub const IDS: &'static [i32] = &[
1940        id::SPAWN_ENTITY,
1941        id::SPAWN_ENTITY_EXPERIENCE_ORB,
1942        id::SPAWN_ENTITY_WEATHER,
1943        id::SPAWN_ENTITY_LIVING,
1944        id::SPAWN_ENTITY_PAINTING,
1945        id::NAMED_ENTITY_SPAWN,
1946        id::ANIMATION,
1947        id::STATISTICS,
1948        id::BLOCK_BREAK_ANIMATION,
1949        id::TILE_ENTITY_DATA,
1950        id::BLOCK_ACTION,
1951        id::BLOCK_CHANGE,
1952        id::BOSS_BAR,
1953        id::DIFFICULTY,
1954        id::TAB_COMPLETE,
1955        id::CHAT,
1956        id::MULTI_BLOCK_CHANGE,
1957        id::TRANSACTION,
1958        id::CLOSE_WINDOW,
1959        id::OPEN_WINDOW,
1960        id::WINDOW_ITEMS,
1961        id::CRAFT_PROGRESS_BAR,
1962        id::SET_SLOT,
1963        id::SET_COOLDOWN,
1964        id::CUSTOM_PAYLOAD,
1965        id::NAMED_SOUND_EFFECT,
1966        id::KICK_DISCONNECT,
1967        id::ENTITY_STATUS,
1968        id::EXPLOSION,
1969        id::UNLOAD_CHUNK,
1970        id::GAME_STATE_CHANGE,
1971        id::KEEP_ALIVE,
1972        id::MAP_CHUNK,
1973        id::WORLD_EVENT,
1974        id::WORLD_PARTICLES,
1975        id::LOGIN,
1976        id::MAP,
1977        id::ENTITY,
1978        id::REL_ENTITY_MOVE,
1979        id::ENTITY_MOVE_LOOK,
1980        id::ENTITY_LOOK,
1981        id::VEHICLE_MOVE,
1982        id::OPEN_SIGN_ENTITY,
1983        id::CRAFT_RECIPE_RESPONSE,
1984        id::ABILITIES,
1985        id::COMBAT_EVENT,
1986        id::PLAYER_INFO,
1987        id::POSITION,
1988        id::BED,
1989        id::UNLOCK_RECIPES,
1990        id::ENTITY_DESTROY,
1991        id::REMOVE_ENTITY_EFFECT,
1992        id::RESOURCE_PACK_SEND,
1993        id::RESPAWN,
1994        id::ENTITY_HEAD_ROTATION,
1995        id::SELECT_ADVANCEMENT_TAB,
1996        id::WORLD_BORDER,
1997        id::CAMERA,
1998        id::HELD_ITEM_SLOT,
1999        id::SCOREBOARD_DISPLAY_OBJECTIVE,
2000        id::ENTITY_METADATA,
2001        id::ATTACH_ENTITY,
2002        id::ENTITY_VELOCITY,
2003        id::ENTITY_EQUIPMENT,
2004        id::EXPERIENCE,
2005        id::UPDATE_HEALTH,
2006        id::SCOREBOARD_OBJECTIVE,
2007        id::SET_PASSENGERS,
2008        id::TEAMS,
2009        id::SCOREBOARD_SCORE,
2010        id::SPAWN_POSITION,
2011        id::UPDATE_TIME,
2012        id::TITLE,
2013        id::SOUND_EFFECT,
2014        id::PLAYERLIST_HEADER,
2015        id::COLLECT,
2016        id::ENTITY_TELEPORT,
2017        id::ADVANCEMENTS,
2018        id::ENTITY_UPDATE_ATTRIBUTES,
2019        id::ENTITY_EFFECT,
2020    ];
2021    /// Generates a random packet with the given id (test support).
2022    #[cfg(feature = "testgen")]
2023    pub fn generate_by_id(id: i32, g: &mut Gen) -> Option<Self> {
2024        match id {
2025            id::SPAWN_ENTITY => Some(Self::SpawnEntity(<SpawnEntity as Generate>::generate(g))),
2026            id::SPAWN_ENTITY_EXPERIENCE_ORB => Some(Self::SpawnEntityExperienceOrb(
2027                <SpawnEntityExperienceOrb as Generate>::generate(g),
2028            )),
2029            id::SPAWN_ENTITY_WEATHER => Some(Self::SpawnEntityWeather(
2030                <SpawnEntityWeather as Generate>::generate(g),
2031            )),
2032            id::SPAWN_ENTITY_LIVING => Some(Self::SpawnEntityLiving(
2033                <SpawnEntityLiving as Generate>::generate(g),
2034            )),
2035            id::SPAWN_ENTITY_PAINTING => Some(Self::SpawnEntityPainting(
2036                <SpawnEntityPainting as Generate>::generate(g),
2037            )),
2038            id::NAMED_ENTITY_SPAWN => Some(Self::NamedEntitySpawn(
2039                <NamedEntitySpawn as Generate>::generate(g),
2040            )),
2041            id::ANIMATION => Some(Self::Animation(<Animation as Generate>::generate(g))),
2042            id::STATISTICS => Some(Self::Statistics(<Statistics as Generate>::generate(g))),
2043            id::BLOCK_BREAK_ANIMATION => Some(Self::BlockBreakAnimation(
2044                <BlockBreakAnimation as Generate>::generate(g),
2045            )),
2046            id::TILE_ENTITY_DATA => Some(Self::TileEntityData(
2047                <TileEntityData as Generate>::generate(g),
2048            )),
2049            id::BLOCK_ACTION => Some(Self::BlockAction(<BlockAction as Generate>::generate(g))),
2050            id::BLOCK_CHANGE => Some(Self::BlockChange(<BlockChange as Generate>::generate(g))),
2051            id::BOSS_BAR => Some(Self::BossBar(<BossBar as Generate>::generate(g))),
2052            id::DIFFICULTY => Some(Self::Difficulty(<Difficulty as Generate>::generate(g))),
2053            id::TAB_COMPLETE => Some(Self::TabComplete(<TabComplete as Generate>::generate(g))),
2054            id::CHAT => Some(Self::Chat(<Chat as Generate>::generate(g))),
2055            id::MULTI_BLOCK_CHANGE => Some(Self::MultiBlockChange(
2056                <MultiBlockChange as Generate>::generate(g),
2057            )),
2058            id::TRANSACTION => Some(Self::Transaction(<Transaction as Generate>::generate(g))),
2059            id::CLOSE_WINDOW => Some(Self::CloseWindow(<CloseWindow as Generate>::generate(g))),
2060            id::OPEN_WINDOW => Some(Self::OpenWindow(<OpenWindow as Generate>::generate(g))),
2061            id::WINDOW_ITEMS => Some(Self::WindowItems(<WindowItems as Generate>::generate(g))),
2062            id::CRAFT_PROGRESS_BAR => Some(Self::CraftProgressBar(
2063                <CraftProgressBar as Generate>::generate(g),
2064            )),
2065            id::SET_SLOT => Some(Self::SetSlot(<SetSlot as Generate>::generate(g))),
2066            id::SET_COOLDOWN => Some(Self::SetCooldown(<SetCooldown as Generate>::generate(g))),
2067            id::CUSTOM_PAYLOAD => Some(Self::CustomPayload(<CustomPayload as Generate>::generate(
2068                g,
2069            ))),
2070            id::NAMED_SOUND_EFFECT => Some(Self::NamedSoundEffect(
2071                <NamedSoundEffect as Generate>::generate(g),
2072            )),
2073            id::KICK_DISCONNECT => Some(Self::KickDisconnect(
2074                <KickDisconnect as Generate>::generate(g),
2075            )),
2076            id::ENTITY_STATUS => Some(Self::EntityStatus(<EntityStatus as Generate>::generate(g))),
2077            id::EXPLOSION => Some(Self::Explosion(<Explosion as Generate>::generate(g))),
2078            id::UNLOAD_CHUNK => Some(Self::UnloadChunk(<UnloadChunk as Generate>::generate(g))),
2079            id::GAME_STATE_CHANGE => Some(Self::GameStateChange(
2080                <GameStateChange as Generate>::generate(g),
2081            )),
2082            id::KEEP_ALIVE => Some(Self::KeepAlive(<KeepAlive as Generate>::generate(g))),
2083            id::MAP_CHUNK => Some(Self::MapChunk(<MapChunk as Generate>::generate(g))),
2084            id::WORLD_EVENT => Some(Self::WorldEvent(<WorldEvent as Generate>::generate(g))),
2085            id::WORLD_PARTICLES => Some(Self::WorldParticles(
2086                <WorldParticles as Generate>::generate(g),
2087            )),
2088            id::LOGIN => Some(Self::Login(<Login as Generate>::generate(g))),
2089            id::MAP => Some(Self::Map(<Map as Generate>::generate(g))),
2090            id::ENTITY => Some(Self::Entity(<Entity as Generate>::generate(g))),
2091            id::REL_ENTITY_MOVE => Some(Self::RelEntityMove(
2092                <RelEntityMove as Generate>::generate(g),
2093            )),
2094            id::ENTITY_MOVE_LOOK => Some(Self::EntityMoveLook(
2095                <EntityMoveLook as Generate>::generate(g),
2096            )),
2097            id::ENTITY_LOOK => Some(Self::EntityLook(<EntityLook as Generate>::generate(g))),
2098            id::VEHICLE_MOVE => Some(Self::VehicleMove(<VehicleMove as Generate>::generate(g))),
2099            id::OPEN_SIGN_ENTITY => Some(Self::OpenSignEntity(
2100                <OpenSignEntity as Generate>::generate(g),
2101            )),
2102            id::CRAFT_RECIPE_RESPONSE => Some(Self::CraftRecipeResponse(
2103                <CraftRecipeResponse as Generate>::generate(g),
2104            )),
2105            id::ABILITIES => Some(Self::Abilities(<Abilities as Generate>::generate(g))),
2106            id::COMBAT_EVENT => Some(Self::CombatEvent(<CombatEvent as Generate>::generate(g))),
2107            id::PLAYER_INFO => Some(Self::PlayerInfo(<PlayerInfo as Generate>::generate(g))),
2108            id::POSITION => Some(Self::Position(<Position as Generate>::generate(g))),
2109            id::BED => Some(Self::Bed(<Bed as Generate>::generate(g))),
2110            id::UNLOCK_RECIPES => Some(Self::UnlockRecipes(<UnlockRecipes as Generate>::generate(
2111                g,
2112            ))),
2113            id::ENTITY_DESTROY => Some(Self::EntityDestroy(<EntityDestroy as Generate>::generate(
2114                g,
2115            ))),
2116            id::REMOVE_ENTITY_EFFECT => Some(Self::RemoveEntityEffect(
2117                <RemoveEntityEffect as Generate>::generate(g),
2118            )),
2119            id::RESOURCE_PACK_SEND => Some(Self::ResourcePackSend(
2120                <ResourcePackSend as Generate>::generate(g),
2121            )),
2122            id::RESPAWN => Some(Self::Respawn(<Respawn as Generate>::generate(g))),
2123            id::ENTITY_HEAD_ROTATION => Some(Self::EntityHeadRotation(
2124                <EntityHeadRotation as Generate>::generate(g),
2125            )),
2126            id::SELECT_ADVANCEMENT_TAB => Some(Self::SelectAdvancementTab(
2127                <SelectAdvancementTab as Generate>::generate(g),
2128            )),
2129            id::WORLD_BORDER => Some(Self::WorldBorder(<WorldBorder as Generate>::generate(g))),
2130            id::CAMERA => Some(Self::Camera(<Camera as Generate>::generate(g))),
2131            id::HELD_ITEM_SLOT => Some(Self::HeldItemSlot(<HeldItemSlot as Generate>::generate(g))),
2132            id::SCOREBOARD_DISPLAY_OBJECTIVE => Some(Self::ScoreboardDisplayObjective(
2133                <ScoreboardDisplayObjective as Generate>::generate(g),
2134            )),
2135            id::ENTITY_METADATA => Some(Self::EntityMetadata(
2136                <EntityMetadata as Generate>::generate(g),
2137            )),
2138            id::ATTACH_ENTITY => Some(Self::AttachEntity(<AttachEntity as Generate>::generate(g))),
2139            id::ENTITY_VELOCITY => Some(Self::EntityVelocity(
2140                <EntityVelocity as Generate>::generate(g),
2141            )),
2142            id::ENTITY_EQUIPMENT => Some(Self::EntityEquipment(
2143                <EntityEquipment as Generate>::generate(g),
2144            )),
2145            id::EXPERIENCE => Some(Self::Experience(<Experience as Generate>::generate(g))),
2146            id::UPDATE_HEALTH => Some(Self::UpdateHealth(<UpdateHealth as Generate>::generate(g))),
2147            id::SCOREBOARD_OBJECTIVE => Some(Self::ScoreboardObjective(
2148                <ScoreboardObjective as Generate>::generate(g),
2149            )),
2150            id::SET_PASSENGERS => Some(Self::SetPassengers(<SetPassengers as Generate>::generate(
2151                g,
2152            ))),
2153            id::TEAMS => Some(Self::Teams(<Teams as Generate>::generate(g))),
2154            id::SCOREBOARD_SCORE => Some(Self::ScoreboardScore(
2155                <ScoreboardScore as Generate>::generate(g),
2156            )),
2157            id::SPAWN_POSITION => Some(Self::SpawnPosition(<SpawnPosition as Generate>::generate(
2158                g,
2159            ))),
2160            id::UPDATE_TIME => Some(Self::UpdateTime(<UpdateTime as Generate>::generate(g))),
2161            id::TITLE => Some(Self::Title(<Title as Generate>::generate(g))),
2162            id::SOUND_EFFECT => Some(Self::SoundEffect(<SoundEffect as Generate>::generate(g))),
2163            id::PLAYERLIST_HEADER => Some(Self::PlayerlistHeader(
2164                <PlayerlistHeader as Generate>::generate(g),
2165            )),
2166            id::COLLECT => Some(Self::Collect(<Collect as Generate>::generate(g))),
2167            id::ENTITY_TELEPORT => Some(Self::EntityTeleport(
2168                <EntityTeleport as Generate>::generate(g),
2169            )),
2170            id::ADVANCEMENTS => Some(Self::Advancements(<Advancements as Generate>::generate(g))),
2171            id::ENTITY_UPDATE_ATTRIBUTES => Some(Self::EntityUpdateAttributes(
2172                <EntityUpdateAttributes as Generate>::generate(g),
2173            )),
2174            id::ENTITY_EFFECT => Some(Self::EntityEffect(<EntityEffect as Generate>::generate(g))),
2175            _ => None,
2176        }
2177    }
2178}