Botcraft 1.21.4
Loading...
Searching...
No Matches
Entity.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <any>
4#include <chrono>
5#include <map>
6#include <memory>
7#include <optional>
8#include <shared_mutex>
9
10#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
12#endif
15
17
20
21#if USE_GUI
23#endif
24
25namespace Botcraft
26{
27 enum class EntityType;
28#if PROTOCOL_VERSION < 458 /* < 1.14 */
29 enum class ObjectEntityType;
30#endif
31
33 {
35 unsigned char amplifier;
36 std::chrono::steady_clock::time_point end;
37 };
38
39 enum class EntitySharedFlagsId : char
40 {
41 OnFire = 0,
42 ShiftKeyDown = 1,
43 // 2 is unused? Maybe in previous versions
44 Sprinting = 3,
45 Swimming = 4,
46 Invisible = 5,
47 Glowing = 6,
48 FallFlying = 7
49 };
50
51 class Entity
52 {
53 protected:
54#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
55 static constexpr int metadata_count = 8;
56#elif PROTOCOL_VERSION > 404 /* > 1.13.2 */
57 static constexpr int metadata_count = 7;
58#else
59 static constexpr int metadata_count = 6;
60#endif
61 static const std::array<std::string, metadata_count> metadata_names;
62 static constexpr int hierarchy_metadata_count = 0;
63
64 public:
65 Entity();
66 virtual ~Entity();
67
68 // Object related stuff
69 virtual std::string GetName() const = 0;
70 virtual EntityType GetType() const = 0;
71 AABB GetCollider() const;
72 double GetWidth() const;
73 double GetHeight() const;
74
75 // Metadata stuff
76 void LoadMetadataFromRawArray(const std::vector<unsigned char>& data);
77 virtual void SetMetadataValue(const int index, const std::any& value);
78
79 char GetDataSharedFlagsId() const;
80 bool GetDataSharedFlagsId(const EntitySharedFlagsId id) const;
81 int GetDataAirSupplyId() const;
82#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
83 std::optional<ProtocolCraft::Chat> GetDataCustomName() const;
84#else
85 std::string GetDataCustomName() const;
86#endif
87 bool GetDataCustomNameVisible() const;
88 bool GetDataSilent() const;
89 bool GetDataNoGravity() const;
90#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
91 Pose GetDataPose() const;
92#endif
93#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
94 int GetDataTicksFrozen() const;
95#endif
96
97 void SetDataSharedFlagsId(const char data_shared_flags_id);
98 void SetDataSharedFlagsId(const EntitySharedFlagsId id, const bool b);
99 void SetDataAirSupplyId(const int data_air_supply_id);
100#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
101 void SetDataCustomName(const std::optional<ProtocolCraft::Chat>& data_custom_name);
102#else
103 void SetDataCustomName(const std::string& data_custom_name);
104#endif
105 void SetDataCustomNameVisible(const bool data_custom_name_visible);
106 void SetDataSilent(const bool data_silent);
107 void SetDataNoGravity(const bool data_no_gravity);
108#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
109 void SetDataPose(const Pose data_pose);
110#endif
111#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
112 void SetDataTicksFrozen(const int data_ticks_frozen);
113#endif
114
115 // Generic properties getter
116 int GetEntityID() const;
119 double GetX() const;
120 double GetY() const;
121 double GetZ() const;
122 float GetYaw() const;
123 float GetPitch() const;
125 double GetSpeedX() const;
126 double GetSpeedY() const;
127 double GetSpeedZ() const;
128 bool GetOnGround() const;
129 std::map<EquipmentSlot, ProtocolCraft::Slot> GetEquipments() const;
131 std::vector<EntityEffect> GetEffects() const;
132#if USE_GUI
133 std::vector<Renderer::Face> GetFaces(const bool reset_uptodate_status);
134 bool GetAreRenderedFacesUpToDate() const;
135#endif
136
137 // Generic properties setter
138 void SetEntityID(const int entity_id_);
139 void SetUUID(const ProtocolCraft::UUID& uuid_);
140 virtual void SetPosition(const Vector3<double>& position_);
141 virtual void SetX(const double x_);
142 virtual void SetY(const double y_);
143 virtual void SetZ(const double z_);
144 virtual void SetYaw(const float yaw_);
145 virtual void SetPitch(const float pitch_);
146 void SetSpeed(const Vector3<double>& speed_);
147 void SetSpeedX(const double speed_x_);
148 void SetSpeedY(const double speed_y_);
149 void SetSpeedZ(const double speed_z_);
150 void SetOnGround(const bool on_ground_);
151 void SetEquipment(const EquipmentSlot slot, const ProtocolCraft::Slot& item);
152 void SetEffects(const std::vector<EntityEffect>& effects_);
153 void AddEffect(const EntityEffect& effect);
154 void RemoveEffect(const EntityEffectType type);
155#if USE_GUI
156 void SetAreRenderedFacesUpToDate(const bool are_rendered_faces_up_to_date_);
157#endif
158
159 // In case it's needed one day, could be useful
161
162 virtual bool IsLocalPlayer() const;
163 virtual bool IsRemotePlayer() const;
164 // Can be used to know if an entity has a certain virtual type as ancestor
165 virtual bool IsLivingEntity() const;
166 virtual bool IsAbstractArrow() const;
167 virtual bool IsAnimal() const;
168 virtual bool IsAmbientCreature() const;
169 virtual bool IsMonster() const;
170#if PROTOCOL_VERSION > 761 /* > 1.19.3 */
171 virtual bool IsDisplay() const;
172#endif
173#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
174 virtual bool IsVehicle() const;
175#endif
176 virtual bool IsTamableAnimal() const;
177 virtual bool IsAbstractSchoolingFish() const;
178 virtual bool IsWaterAnimal() const;
179 virtual bool IsAbstractChestedHorse() const;
180 virtual bool IsAbstractHurtingProjectile() const;
181 virtual bool IsMob() const;
182 virtual bool IsSpellcasterIllager() const;
183#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
184 virtual bool IsProjectile() const;
185#endif
186 virtual bool IsFlyingMob() const;
187 virtual bool IsAbstractHorse() const;
188 virtual bool IsAbstractGolem() const;
189 virtual bool IsHangingEntity() const;
190 virtual bool IsFireball() const;
191 virtual bool IsAbstractMinecart() const;
192 virtual bool IsAbstractMinecartContainer() const;
193 virtual bool IsShoulderRidingEntity() const;
194#if PROTOCOL_VERSION > 736 /* > 1.16.1 */
195 virtual bool IsAbstractPiglin() const;
196#endif
197 virtual bool IsAbstractIllager() const;
198 virtual bool IsAbstractFish() const;
199#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
200 virtual bool IsRaider() const;
201#endif
202 virtual bool IsAbstractSkeleton() const;
203 virtual bool IsThrowableItemProjectile() const;
204#if PROTOCOL_VERSION > 477 /* > 1.14 */
205 virtual bool IsAbstractVillager() const;
206#endif
207 virtual bool IsAgeableMob() const;
208 virtual bool IsPathfinderMob() const;
209#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
210 virtual bool IsPatrollingMonster() const;
211#endif
212 virtual bool IsThrowableProjectile() const;
213#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
214 virtual bool IsAbstractWindCharge() const;
215#endif
216#if PROTOCOL_VERSION > 766 /* > 1.20.6 */
217 virtual bool IsBlockAttachedEntity() const;
218#endif
219#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
220 virtual bool IsAbstractBoat() const;
221 virtual bool IsAbstractChestBoat() const;
222 virtual bool IsAgeableWaterCreature() const;
223 virtual bool IsBoat() const;
224 virtual bool IsChestBoat() const;
225 virtual bool IsChestRaft() const;
226 virtual bool IsRaft() const;
227#endif
228
229 // Factory stuff
230 static std::shared_ptr<Entity> CreateEntity(const EntityType type);
231#if PROTOCOL_VERSION < 458 /* < 1.14 */
232 static std::shared_ptr<Entity> CreateObjectEntity(const ObjectEntityType type);
233#endif
234
235 protected:
236#if USE_GUI
237 virtual void InitializeFaces();
238 void OnSizeUpdated();
239#endif
240 char GetDataSharedFlagsIdImpl() const;
242 void SetDataSharedFlagsIdImpl(const char data_shared_flags_id);
243 void SetDataSharedFlagsIdImpl(const EntitySharedFlagsId id, const bool b);
244#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
245 Pose GetDataPoseImpl() const;
246 void SetDataPoseImpl(const Pose data_pose);
247#endif
248 AABB GetColliderImpl() const;
249 virtual double GetWidthImpl() const;
250 virtual double GetHeightImpl() const;
251
252 protected:
253 mutable std::shared_mutex entity_mutex;
254
258 float yaw;
259 float pitch;
262 /// @brief Items on this entity. Note that for the local player
263 /// this will **NOT** be populated. Check corresponding
264 /// player inventory slots instead.
265 std::map<EquipmentSlot, ProtocolCraft::Slot> equipments;
266 std::vector<EntityEffect> effects;
267
268 std::map<std::string, std::any> metadata;
269
270#if USE_GUI
271 //All the faces of this model
272 std::vector<FaceDescriptor> face_descriptors;
273 std::vector<Renderer::Face> faces;
274
276#endif
277 };
278
279 enum class EntityType
280 {
281 None = -1,
282#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
283 AcaciaBoat = 0,
284 AcaciaChestBoat = 1,
285 Allay = 2,
286 AreaEffectCloud = 3,
287 Armadillo = 4,
288 ArmorStand = 5,
289 Arrow = 6,
290 Axolotl = 7,
291 ChestRaft = 8,
292 Raft = 9,
293 Bat = 10,
294 Bee = 11,
295 BirchBoat = 12,
296 BirchChestBoat = 13,
297 Blaze = 14,
299 Bogged = 16,
300 Breeze = 17,
301 BreezeWindCharge = 18,
302 Camel = 19,
303 Cat = 20,
304 CaveSpider = 21,
305 CherryBoat = 22,
306 CherryChestBoat = 23,
307 MinecartChest = 24,
308 Chicken = 25,
309 Cod = 26,
311 Cow = 28,
312 Creaking = 29,
313 Creeper = 30,
314 DarkOakBoat = 31,
315 DarkOakChestBoat = 32,
316 Dolphin = 33,
317 Donkey = 34,
318 DragonFireball = 35,
319 Drowned = 36,
320 ThrownEgg = 37,
321 ElderGuardian = 38,
322 EnderMan = 39,
323 Endermite = 40,
324 EnderDragon = 41,
325 ThrownEnderpearl = 42,
326 EndCrystal = 43,
327 Evoker = 44,
328 EvokerFangs = 45,
330 ExperienceOrb = 47,
331 EyeOfEnder = 48,
333 LargeFireball = 50,
335 Fox = 52,
336 Frog = 53,
337 MinecartFurnace = 54,
338 Ghast = 55,
339 Giant = 56,
340 GlowItemFrame = 57,
341 GlowSquid = 58,
342 Goat = 59,
343 Guardian = 60,
344 Hoglin = 61,
345 MinecartHopper = 62,
346 Horse = 63,
347 Husk = 64,
348 Illusioner = 65,
349 Interaction = 66,
350 IronGolem = 67,
351 ItemEntity = 68,
353 ItemFrame = 70,
354 JungleBoat = 71,
355 JungleChestBoat = 72,
357 LightningBolt = 74,
358 Llama = 75,
359 LlamaSpit = 76,
360 MagmaCube = 77,
361 MangroveBoat = 78,
363 Marker = 80,
364 Minecart = 81,
365 MushroomCow = 82,
366 Mule = 83,
367 OakBoat = 84,
368 OakChestBoat = 85,
369 Ocelot = 86,
371 Painting = 88,
372 PaleOakBoat = 89,
373 PaleOakChestBoat = 90,
374 Panda = 91,
375 Parrot = 92,
376 Phantom = 93,
377 Pig = 94,
378 Piglin = 95,
379 PiglinBrute = 96,
380 Pillager = 97,
381 PolarBear = 98,
382 ThrownPotion = 99,
383 Pufferfish = 100,
384 Rabbit = 101,
385 Ravager = 102,
386 Salmon = 103,
387 Sheep = 104,
388 Shulker = 105,
389 ShulkerBullet = 106,
390 Silverfish = 107,
391 Skeleton = 108,
392 SkeletonHorse = 109,
393 Slime = 110,
394 SmallFireball = 111,
395 Sniffer = 112,
396 Snowball = 113,
397 SnowGolem = 114,
398 MinecartSpawner = 115,
399 SpectralArrow = 116,
400 Spider = 117,
401 SpruceBoat = 118,
402 SpruceChestBoat = 119,
403 Squid = 120,
404 Stray = 121,
405 Strider = 122,
406 Tadpole = 123,
407 DisplayTextDisplay = 124,
408 PrimedTnt = 125,
409 MinecartTNT = 126,
410 TraderLlama = 127,
411 ThrownTrident = 128,
412 TropicalFish = 129,
413 Turtle = 130,
414 Vex = 131,
415 Villager = 132,
416 Vindicator = 133,
417 WanderingTrader = 134,
418 Warden = 135,
419 WindCharge = 136,
420 Witch = 137,
421 WitherBoss = 138,
422 WitherSkeleton = 139,
423 WitherSkull = 140,
424 Wolf = 141,
425 Zoglin = 142,
426 Zombie = 143,
427 ZombieHorse = 144,
428 ZombieVillager = 145,
429 ZombifiedPiglin = 146,
430 Player = 147,
431 FishingHook = 148,
432#elif PROTOCOL_VERSION > 767 /* > 1.21.1 */
433 AcaciaBoat = 0,
434 AcaciaChestBoat = 1,
435 Allay = 2,
436 AreaEffectCloud = 3,
437 Armadillo = 4,
438 ArmorStand = 5,
439 Arrow = 6,
440 Axolotl = 7,
441 ChestRaft = 8,
442 Raft = 9,
443 Bat = 10,
444 Bee = 11,
445 BirchBoat = 12,
446 BirchChestBoat = 13,
447 Blaze = 14,
449 Bogged = 16,
450 Breeze = 17,
451 BreezeWindCharge = 18,
452 Camel = 19,
453 Cat = 20,
454 CaveSpider = 21,
455 CherryBoat = 22,
456 CherryChestBoat = 23,
457 MinecartChest = 24,
458 Chicken = 25,
459 Cod = 26,
461 Cow = 28,
462 Creaking = 29,
463 CreakingTransient = 30,
464 Creeper = 31,
465 DarkOakBoat = 32,
466 DarkOakChestBoat = 33,
467 Dolphin = 34,
468 Donkey = 35,
469 DragonFireball = 36,
470 Drowned = 37,
471 ThrownEgg = 38,
472 ElderGuardian = 39,
473 EnderMan = 40,
474 Endermite = 41,
475 EnderDragon = 42,
476 ThrownEnderpearl = 43,
477 EndCrystal = 44,
478 Evoker = 45,
479 EvokerFangs = 46,
481 ExperienceOrb = 48,
482 EyeOfEnder = 49,
484 LargeFireball = 51,
486 Fox = 53,
487 Frog = 54,
488 MinecartFurnace = 55,
489 Ghast = 56,
490 Giant = 57,
491 GlowItemFrame = 58,
492 GlowSquid = 59,
493 Goat = 60,
494 Guardian = 61,
495 Hoglin = 62,
496 MinecartHopper = 63,
497 Horse = 64,
498 Husk = 65,
499 Illusioner = 66,
500 Interaction = 67,
501 IronGolem = 68,
502 ItemEntity = 69,
504 ItemFrame = 71,
505 JungleBoat = 72,
506 JungleChestBoat = 73,
508 LightningBolt = 75,
509 Llama = 76,
510 LlamaSpit = 77,
511 MagmaCube = 78,
512 MangroveBoat = 79,
514 Marker = 81,
515 Minecart = 82,
516 MushroomCow = 83,
517 Mule = 84,
518 OakBoat = 85,
519 OakChestBoat = 86,
520 Ocelot = 87,
522 Painting = 89,
523 PaleOakBoat = 90,
524 PaleOakChestBoat = 91,
525 Panda = 92,
526 Parrot = 93,
527 Phantom = 94,
528 Pig = 95,
529 Piglin = 96,
530 PiglinBrute = 97,
531 Pillager = 98,
532 PolarBear = 99,
533 ThrownPotion = 100,
534 Pufferfish = 101,
535 Rabbit = 102,
536 Ravager = 103,
537 Salmon = 104,
538 Sheep = 105,
539 Shulker = 106,
540 ShulkerBullet = 107,
541 Silverfish = 108,
542 Skeleton = 109,
543 SkeletonHorse = 110,
544 Slime = 111,
545 SmallFireball = 112,
546 Sniffer = 113,
547 Snowball = 114,
548 SnowGolem = 115,
549 MinecartSpawner = 116,
550 SpectralArrow = 117,
551 Spider = 118,
552 SpruceBoat = 119,
553 SpruceChestBoat = 120,
554 Squid = 121,
555 Stray = 122,
556 Strider = 123,
557 Tadpole = 124,
558 DisplayTextDisplay = 125,
559 PrimedTnt = 126,
560 MinecartTNT = 127,
561 TraderLlama = 128,
562 ThrownTrident = 129,
563 TropicalFish = 130,
564 Turtle = 131,
565 Vex = 132,
566 Villager = 133,
567 Vindicator = 134,
568 WanderingTrader = 135,
569 Warden = 136,
570 WindCharge = 137,
571 Witch = 138,
572 WitherBoss = 139,
573 WitherSkeleton = 140,
574 WitherSkull = 141,
575 Wolf = 142,
576 Zoglin = 143,
577 Zombie = 144,
578 ZombieHorse = 145,
579 ZombieVillager = 146,
580 ZombifiedPiglin = 147,
581 Player = 148,
582 FishingHook = 149,
583#elif PROTOCOL_VERSION > 765 /* > 1.20.4 */
584 Allay = 0,
585 AreaEffectCloud = 1,
586 Armadillo = 2,
587 ArmorStand = 3,
588 Arrow = 4,
589 Axolotl = 5,
590 Bat = 6,
591 Bee = 7,
592 Blaze = 8,
594 Boat = 10,
595 Bogged = 11,
596 Breeze = 12,
597 BreezeWindCharge = 13,
598 Camel = 14,
599 Cat = 15,
600 CaveSpider = 16,
601 ChestBoat = 17,
602 MinecartChest = 18,
603 Chicken = 19,
604 Cod = 20,
606 Cow = 22,
607 Creeper = 23,
608 Dolphin = 24,
609 Donkey = 25,
610 DragonFireball = 26,
611 Drowned = 27,
612 ThrownEgg = 28,
613 ElderGuardian = 29,
614 EndCrystal = 30,
615 EnderDragon = 31,
616 ThrownEnderpearl = 32,
617 EnderMan = 33,
618 Endermite = 34,
619 Evoker = 35,
620 EvokerFangs = 36,
622 ExperienceOrb = 38,
623 EyeOfEnder = 39,
626 Fox = 42,
627 Frog = 43,
628 MinecartFurnace = 44,
629 Ghast = 45,
630 Giant = 46,
631 GlowItemFrame = 47,
632 GlowSquid = 48,
633 Goat = 49,
634 Guardian = 50,
635 Hoglin = 51,
636 MinecartHopper = 52,
637 Horse = 53,
638 Husk = 54,
639 Illusioner = 55,
640 Interaction = 56,
641 IronGolem = 57,
642 ItemEntity = 58,
644 ItemFrame = 60,
646 LargeFireball = 62,
648 LightningBolt = 64,
649 Llama = 65,
650 LlamaSpit = 66,
651 MagmaCube = 67,
652 Marker = 68,
653 Minecart = 69,
654 MushroomCow = 70,
655 Mule = 71,
656 Ocelot = 72,
657 Painting = 73,
658 Panda = 74,
659 Parrot = 75,
660 Phantom = 76,
661 Pig = 77,
662 Piglin = 78,
663 PiglinBrute = 79,
664 Pillager = 80,
665 PolarBear = 81,
666 ThrownPotion = 82,
667 Pufferfish = 83,
668 Rabbit = 84,
669 Ravager = 85,
670 Salmon = 86,
671 Sheep = 87,
672 Shulker = 88,
673 ShulkerBullet = 89,
674 Silverfish = 90,
675 Skeleton = 91,
676 SkeletonHorse = 92,
677 Slime = 93,
678 SmallFireball = 94,
679 Sniffer = 95,
680 SnowGolem = 96,
681 Snowball = 97,
682 MinecartSpawner = 98,
683 SpectralArrow = 99,
684 Spider = 100,
685 Squid = 101,
686 Stray = 102,
687 Strider = 103,
688 Tadpole = 104,
689 DisplayTextDisplay = 105,
690 PrimedTnt = 106,
691 MinecartTNT = 107,
692 TraderLlama = 108,
693 ThrownTrident = 109,
694 TropicalFish = 110,
695 Turtle = 111,
696 Vex = 112,
697 Villager = 113,
698 Vindicator = 114,
699 WanderingTrader = 115,
700 Warden = 116,
701 WindCharge = 117,
702 Witch = 118,
703 WitherBoss = 119,
704 WitherSkeleton = 120,
705 WitherSkull = 121,
706 Wolf = 122,
707 Zoglin = 123,
708 Zombie = 124,
709 ZombieHorse = 125,
710 ZombieVillager = 126,
711 ZombifiedPiglin = 127,
712 Player = 128,
713 FishingHook = 129,
714#elif PROTOCOL_VERSION > 764 /* > 1.20.2 */
715 Allay = 0,
716 AreaEffectCloud = 1,
717 ArmorStand = 2,
718 Arrow = 3,
719 Axolotl = 4,
720 Bat = 5,
721 Bee = 6,
722 Blaze = 7,
724 Boat = 9,
725 Breeze = 10,
726 Camel = 11,
727 Cat = 12,
728 CaveSpider = 13,
729 ChestBoat = 14,
730 MinecartChest = 15,
731 Chicken = 16,
732 Cod = 17,
734 Cow = 19,
735 Creeper = 20,
736 Dolphin = 21,
737 Donkey = 22,
738 DragonFireball = 23,
739 Drowned = 24,
740 ThrownEgg = 25,
741 ElderGuardian = 26,
742 EndCrystal = 27,
743 EnderDragon = 28,
744 ThrownEnderpearl = 29,
745 EnderMan = 30,
746 Endermite = 31,
747 Evoker = 32,
748 EvokerFangs = 33,
750 ExperienceOrb = 35,
751 EyeOfEnder = 36,
754 Fox = 39,
755 Frog = 40,
756 MinecartFurnace = 41,
757 Ghast = 42,
758 Giant = 43,
759 GlowItemFrame = 44,
760 GlowSquid = 45,
761 Goat = 46,
762 Guardian = 47,
763 Hoglin = 48,
764 MinecartHopper = 49,
765 Horse = 50,
766 Husk = 51,
767 Illusioner = 52,
768 Interaction = 53,
769 IronGolem = 54,
770 ItemEntity = 55,
772 ItemFrame = 57,
773 LargeFireball = 58,
775 LightningBolt = 60,
776 Llama = 61,
777 LlamaSpit = 62,
778 MagmaCube = 63,
779 Marker = 64,
780 Minecart = 65,
781 MushroomCow = 66,
782 Mule = 67,
783 Ocelot = 68,
784 Painting = 69,
785 Panda = 70,
786 Parrot = 71,
787 Phantom = 72,
788 Pig = 73,
789 Piglin = 74,
790 PiglinBrute = 75,
791 Pillager = 76,
792 PolarBear = 77,
793 ThrownPotion = 78,
794 Pufferfish = 79,
795 Rabbit = 80,
796 Ravager = 81,
797 Salmon = 82,
798 Sheep = 83,
799 Shulker = 84,
800 ShulkerBullet = 85,
801 Silverfish = 86,
802 Skeleton = 87,
803 SkeletonHorse = 88,
804 Slime = 89,
805 SmallFireball = 90,
806 Sniffer = 91,
807 SnowGolem = 92,
808 Snowball = 93,
809 MinecartSpawner = 94,
810 SpectralArrow = 95,
811 Spider = 96,
812 Squid = 97,
813 Stray = 98,
814 Strider = 99,
815 Tadpole = 100,
816 DisplayTextDisplay = 101,
817 PrimedTnt = 102,
818 MinecartTNT = 103,
819 TraderLlama = 104,
820 ThrownTrident = 105,
821 TropicalFish = 106,
822 Turtle = 107,
823 Vex = 108,
824 Villager = 109,
825 Vindicator = 110,
826 WanderingTrader = 111,
827 Warden = 112,
828 WindCharge = 113,
829 Witch = 114,
830 WitherBoss = 115,
831 WitherSkeleton = 116,
832 WitherSkull = 117,
833 Wolf = 118,
834 Zoglin = 119,
835 Zombie = 120,
836 ZombieHorse = 121,
837 ZombieVillager = 122,
838 ZombifiedPiglin = 123,
839 Player = 124,
840 FishingHook = 125,
841#elif PROTOCOL_VERSION > 761 /* > 1.19.3 */
842 Allay = 0,
843 AreaEffectCloud = 1,
844 ArmorStand = 2,
845 Arrow = 3,
846 Axolotl = 4,
847 Bat = 5,
848 Bee = 6,
849 Blaze = 7,
851 Boat = 9,
852 Camel = 10,
853 Cat = 11,
854 CaveSpider = 12,
855 ChestBoat = 13,
856 MinecartChest = 14,
857 Chicken = 15,
858 Cod = 16,
860 Cow = 18,
861 Creeper = 19,
862 Dolphin = 20,
863 Donkey = 21,
864 DragonFireball = 22,
865 Drowned = 23,
866 ThrownEgg = 24,
867 ElderGuardian = 25,
868 EndCrystal = 26,
869 EnderDragon = 27,
870 ThrownEnderpearl = 28,
871 EnderMan = 29,
872 Endermite = 30,
873 Evoker = 31,
874 EvokerFangs = 32,
876 ExperienceOrb = 34,
877 EyeOfEnder = 35,
880 Fox = 38,
881 Frog = 39,
882 MinecartFurnace = 40,
883 Ghast = 41,
884 Giant = 42,
885 GlowItemFrame = 43,
886 GlowSquid = 44,
887 Goat = 45,
888 Guardian = 46,
889 Hoglin = 47,
890 MinecartHopper = 48,
891 Horse = 49,
892 Husk = 50,
893 Illusioner = 51,
894 Interaction = 52,
895 IronGolem = 53,
896 ItemEntity = 54,
898 ItemFrame = 56,
899 LargeFireball = 57,
901 LightningBolt = 59,
902 Llama = 60,
903 LlamaSpit = 61,
904 MagmaCube = 62,
905 Marker = 63,
906 Minecart = 64,
907 MushroomCow = 65,
908 Mule = 66,
909 Ocelot = 67,
910 Painting = 68,
911 Panda = 69,
912 Parrot = 70,
913 Phantom = 71,
914 Pig = 72,
915 Piglin = 73,
916 PiglinBrute = 74,
917 Pillager = 75,
918 PolarBear = 76,
919 ThrownPotion = 77,
920 Pufferfish = 78,
921 Rabbit = 79,
922 Ravager = 80,
923 Salmon = 81,
924 Sheep = 82,
925 Shulker = 83,
926 ShulkerBullet = 84,
927 Silverfish = 85,
928 Skeleton = 86,
929 SkeletonHorse = 87,
930 Slime = 88,
931 SmallFireball = 89,
932 Sniffer = 90,
933 SnowGolem = 91,
934 Snowball = 92,
935 MinecartSpawner = 93,
936 SpectralArrow = 94,
937 Spider = 95,
938 Squid = 96,
939 Stray = 97,
940 Strider = 98,
941 Tadpole = 99,
942 DisplayTextDisplay = 100,
943 PrimedTnt = 101,
944 MinecartTNT = 102,
945 TraderLlama = 103,
946 ThrownTrident = 104,
947 TropicalFish = 105,
948 Turtle = 106,
949 Vex = 107,
950 Villager = 108,
951 Vindicator = 109,
952 WanderingTrader = 110,
953 Warden = 111,
954 Witch = 112,
955 WitherBoss = 113,
956 WitherSkeleton = 114,
957 WitherSkull = 115,
958 Wolf = 116,
959 Zoglin = 117,
960 Zombie = 118,
961 ZombieHorse = 119,
962 ZombieVillager = 120,
963 ZombifiedPiglin = 121,
964 Player = 122,
965 FishingHook = 123,
966#elif PROTOCOL_VERSION > 760 /* > 1.19.2 */
967 Allay = 0,
968 AreaEffectCloud = 1,
969 ArmorStand = 2,
970 Arrow = 3,
971 Axolotl = 4,
972 Bat = 5,
973 Bee = 6,
974 Blaze = 7,
975 Boat = 8,
976 ChestBoat = 9,
977 Cat = 10,
978 Camel = 11,
979 CaveSpider = 12,
980 Chicken = 13,
981 Cod = 14,
982 Cow = 15,
983 Creeper = 16,
984 Dolphin = 17,
985 Donkey = 18,
986 DragonFireball = 19,
987 Drowned = 20,
988 ElderGuardian = 21,
989 EndCrystal = 22,
990 EnderDragon = 23,
991 EnderMan = 24,
992 Endermite = 25,
993 Evoker = 26,
994 EvokerFangs = 27,
995 ExperienceOrb = 28,
996 EyeOfEnder = 29,
999 Fox = 32,
1000 Frog = 33,
1001 Ghast = 34,
1002 Giant = 35,
1003 GlowItemFrame = 36,
1004 GlowSquid = 37,
1005 Goat = 38,
1006 Guardian = 39,
1007 Hoglin = 40,
1008 Horse = 41,
1009 Husk = 42,
1010 Illusioner = 43,
1011 IronGolem = 44,
1012 ItemEntity = 45,
1013 ItemFrame = 46,
1014 LargeFireball = 47,
1016 LightningBolt = 49,
1017 Llama = 50,
1018 LlamaSpit = 51,
1019 MagmaCube = 52,
1020 Marker = 53,
1021 Minecart = 54,
1022 MinecartChest = 55,
1024 MinecartFurnace = 57,
1025 MinecartHopper = 58,
1026 MinecartSpawner = 59,
1027 MinecartTNT = 60,
1028 Mule = 61,
1029 MushroomCow = 62,
1030 Ocelot = 63,
1031 Painting = 64,
1032 Panda = 65,
1033 Parrot = 66,
1034 Phantom = 67,
1035 Pig = 68,
1036 Piglin = 69,
1037 PiglinBrute = 70,
1038 Pillager = 71,
1039 PolarBear = 72,
1040 PrimedTnt = 73,
1041 Pufferfish = 74,
1042 Rabbit = 75,
1043 Ravager = 76,
1044 Salmon = 77,
1045 Sheep = 78,
1046 Shulker = 79,
1047 ShulkerBullet = 80,
1048 Silverfish = 81,
1049 Skeleton = 82,
1050 SkeletonHorse = 83,
1051 Slime = 84,
1052 SmallFireball = 85,
1053 SnowGolem = 86,
1054 Snowball = 87,
1055 SpectralArrow = 88,
1056 Spider = 89,
1057 Squid = 90,
1058 Stray = 91,
1059 Strider = 92,
1060 Tadpole = 93,
1061 ThrownEgg = 94,
1062 ThrownEnderpearl = 95,
1064 ThrownPotion = 97,
1065 ThrownTrident = 98,
1066 TraderLlama = 99,
1067 TropicalFish = 100,
1068 Turtle = 101,
1069 Vex = 102,
1070 Villager = 103,
1071 Vindicator = 104,
1072 WanderingTrader = 105,
1073 Warden = 106,
1074 Witch = 107,
1075 WitherBoss = 108,
1076 WitherSkeleton = 109,
1077 WitherSkull = 110,
1078 Wolf = 111,
1079 Zoglin = 112,
1080 Zombie = 113,
1081 ZombieHorse = 114,
1082 ZombieVillager = 115,
1083 ZombifiedPiglin = 116,
1084 Player = 117,
1085 FishingHook = 118,
1086#elif PROTOCOL_VERSION > 758 /* > 1.18.2 */
1087 Allay = 0,
1088 AreaEffectCloud = 1,
1089 ArmorStand = 2,
1090 Arrow = 3,
1091 Axolotl = 4,
1092 Bat = 5,
1093 Bee = 6,
1094 Blaze = 7,
1095 Boat = 8,
1096 ChestBoat = 9,
1097 Cat = 10,
1098 CaveSpider = 11,
1099 Chicken = 12,
1100 Cod = 13,
1101 Cow = 14,
1102 Creeper = 15,
1103 Dolphin = 16,
1104 Donkey = 17,
1105 DragonFireball = 18,
1106 Drowned = 19,
1107 ElderGuardian = 20,
1108 EndCrystal = 21,
1109 EnderDragon = 22,
1110 EnderMan = 23,
1111 Endermite = 24,
1112 Evoker = 25,
1113 EvokerFangs = 26,
1114 ExperienceOrb = 27,
1115 EyeOfEnder = 28,
1116 FallingBlockEntity = 29,
1118 Fox = 31,
1119 Frog = 32,
1120 Ghast = 33,
1121 Giant = 34,
1122 GlowItemFrame = 35,
1123 GlowSquid = 36,
1124 Goat = 37,
1125 Guardian = 38,
1126 Hoglin = 39,
1127 Horse = 40,
1128 Husk = 41,
1129 Illusioner = 42,
1130 IronGolem = 43,
1131 ItemEntity = 44,
1132 ItemFrame = 45,
1133 LargeFireball = 46,
1135 LightningBolt = 48,
1136 Llama = 49,
1137 LlamaSpit = 50,
1138 MagmaCube = 51,
1139 Marker = 52,
1140 Minecart = 53,
1141 MinecartChest = 54,
1143 MinecartFurnace = 56,
1144 MinecartHopper = 57,
1145 MinecartSpawner = 58,
1146 MinecartTNT = 59,
1147 Mule = 60,
1148 MushroomCow = 61,
1149 Ocelot = 62,
1150 Painting = 63,
1151 Panda = 64,
1152 Parrot = 65,
1153 Phantom = 66,
1154 Pig = 67,
1155 Piglin = 68,
1156 PiglinBrute = 69,
1157 Pillager = 70,
1158 PolarBear = 71,
1159 PrimedTnt = 72,
1160 Pufferfish = 73,
1161 Rabbit = 74,
1162 Ravager = 75,
1163 Salmon = 76,
1164 Sheep = 77,
1165 Shulker = 78,
1166 ShulkerBullet = 79,
1167 Silverfish = 80,
1168 Skeleton = 81,
1169 SkeletonHorse = 82,
1170 Slime = 83,
1171 SmallFireball = 84,
1172 SnowGolem = 85,
1173 Snowball = 86,
1174 SpectralArrow = 87,
1175 Spider = 88,
1176 Squid = 89,
1177 Stray = 90,
1178 Strider = 91,
1179 Tadpole = 92,
1180 ThrownEgg = 93,
1181 ThrownEnderpearl = 94,
1183 ThrownPotion = 96,
1184 ThrownTrident = 97,
1185 TraderLlama = 98,
1186 TropicalFish = 99,
1187 Turtle = 100,
1188 Vex = 101,
1189 Villager = 102,
1190 Vindicator = 103,
1191 WanderingTrader = 104,
1192 Warden = 105,
1193 Witch = 106,
1194 WitherBoss = 107,
1195 WitherSkeleton = 108,
1196 WitherSkull = 109,
1197 Wolf = 110,
1198 Zoglin = 111,
1199 Zombie = 112,
1200 ZombieHorse = 113,
1201 ZombieVillager = 114,
1202 ZombifiedPiglin = 115,
1203 Player = 116,
1204 FishingHook = 117,
1205#elif PROTOCOL_VERSION > 754 /* > 1.16.5 */
1206 AreaEffectCloud = 0,
1207 ArmorStand = 1,
1208 Arrow = 2,
1209 Axolotl = 3,
1210 Bat = 4,
1211 Bee = 5,
1212 Blaze = 6,
1213 Boat = 7,
1214 Cat = 8,
1215 CaveSpider = 9,
1216 Chicken = 10,
1217 Cod = 11,
1218 Cow = 12,
1219 Creeper = 13,
1220 Dolphin = 14,
1221 Donkey = 15,
1222 DragonFireball = 16,
1223 Drowned = 17,
1224 ElderGuardian = 18,
1225 EndCrystal = 19,
1226 EnderDragon = 20,
1227 EnderMan = 21,
1228 Endermite = 22,
1229 Evoker = 23,
1230 EvokerFangs = 24,
1231 ExperienceOrb = 25,
1232 EyeOfEnder = 26,
1233 FallingBlockEntity = 27,
1235 Fox = 29,
1236 Ghast = 30,
1237 Giant = 31,
1238 GlowItemFrame = 32,
1239 GlowSquid = 33,
1240 Goat = 34,
1241 Guardian = 35,
1242 Hoglin = 36,
1243 Horse = 37,
1244 Husk = 38,
1245 Illusioner = 39,
1246 IronGolem = 40,
1247 ItemEntity = 41,
1248 ItemFrame = 42,
1249 LargeFireball = 43,
1251 LightningBolt = 45,
1252 Llama = 46,
1253 LlamaSpit = 47,
1254 MagmaCube = 48,
1255 Marker = 49,
1256 Minecart = 50,
1257 MinecartChest = 51,
1259 MinecartFurnace = 53,
1260 MinecartHopper = 54,
1261 MinecartSpawner = 55,
1262 MinecartTNT = 56,
1263 Mule = 57,
1264 MushroomCow = 58,
1265 Ocelot = 59,
1266 Painting = 60,
1267 Panda = 61,
1268 Parrot = 62,
1269 Phantom = 63,
1270 Pig = 64,
1271 Piglin = 65,
1272 PiglinBrute = 66,
1273 Pillager = 67,
1274 PolarBear = 68,
1275 PrimedTnt = 69,
1276 Pufferfish = 70,
1277 Rabbit = 71,
1278 Ravager = 72,
1279 Salmon = 73,
1280 Sheep = 74,
1281 Shulker = 75,
1282 ShulkerBullet = 76,
1283 Silverfish = 77,
1284 Skeleton = 78,
1285 SkeletonHorse = 79,
1286 Slime = 80,
1287 SmallFireball = 81,
1288 SnowGolem = 82,
1289 Snowball = 83,
1290 SpectralArrow = 84,
1291 Spider = 85,
1292 Squid = 86,
1293 Stray = 87,
1294 Strider = 88,
1295 ThrownEgg = 89,
1296 ThrownEnderpearl = 90,
1298 ThrownPotion = 92,
1299 ThrownTrident = 93,
1300 TraderLlama = 94,
1301 TropicalFish = 95,
1302 Turtle = 96,
1303 Vex = 97,
1304 Villager = 98,
1305 Vindicator = 99,
1306 WanderingTrader = 100,
1307 Witch = 101,
1308 WitherBoss = 102,
1309 WitherSkeleton = 103,
1310 WitherSkull = 104,
1311 Wolf = 105,
1312 Zoglin = 106,
1313 Zombie = 107,
1314 ZombieHorse = 108,
1315 ZombieVillager = 109,
1316 ZombifiedPiglin = 110,
1317 Player = 111,
1318 FishingHook = 112,
1319#elif PROTOCOL_VERSION > 736 /* > 1.16.1 */
1320 AreaEffectCloud = 0,
1321 ArmorStand = 1,
1322 Arrow = 2,
1323 Bat = 3,
1324 Bee = 4,
1325 Blaze = 5,
1326 Boat = 6,
1327 Cat = 7,
1328 CaveSpider = 8,
1329 Chicken = 9,
1330 Cod = 10,
1331 Cow = 11,
1332 Creeper = 12,
1333 Dolphin = 13,
1334 Donkey = 14,
1335 DragonFireball = 15,
1336 Drowned = 16,
1337 ElderGuardian = 17,
1338 EndCrystal = 18,
1339 EnderDragon = 19,
1340 EnderMan = 20,
1341 Endermite = 21,
1342 Evoker = 22,
1343 EvokerFangs = 23,
1344 ExperienceOrb = 24,
1345 EyeOfEnder = 25,
1346 FallingBlockEntity = 26,
1348 Fox = 28,
1349 Ghast = 29,
1350 Giant = 30,
1351 Guardian = 31,
1352 Hoglin = 32,
1353 Horse = 33,
1354 Husk = 34,
1355 Illusioner = 35,
1356 IronGolem = 36,
1357 ItemEntity = 37,
1358 ItemFrame = 38,
1359 LargeFireball = 39,
1361 LightningBolt = 41,
1362 Llama = 42,
1363 LlamaSpit = 43,
1364 MagmaCube = 44,
1365 Minecart = 45,
1366 MinecartChest = 46,
1368 MinecartFurnace = 48,
1369 MinecartHopper = 49,
1370 MinecartSpawner = 50,
1371 MinecartTNT = 51,
1372 Mule = 52,
1373 MushroomCow = 53,
1374 Ocelot = 54,
1375 Painting = 55,
1376 Panda = 56,
1377 Parrot = 57,
1378 Phantom = 58,
1379 Pig = 59,
1380 Piglin = 60,
1381 PiglinBrute = 61,
1382 Pillager = 62,
1383 PolarBear = 63,
1384 PrimedTnt = 64,
1385 Pufferfish = 65,
1386 Rabbit = 66,
1387 Ravager = 67,
1388 Salmon = 68,
1389 Sheep = 69,
1390 Shulker = 70,
1391 ShulkerBullet = 71,
1392 Silverfish = 72,
1393 Skeleton = 73,
1394 SkeletonHorse = 74,
1395 Slime = 75,
1396 SmallFireball = 76,
1397 SnowGolem = 77,
1398 Snowball = 78,
1399 SpectralArrow = 79,
1400 Spider = 80,
1401 Squid = 81,
1402 Stray = 82,
1403 Strider = 83,
1404 ThrownEgg = 84,
1405 ThrownEnderpearl = 85,
1407 ThrownPotion = 87,
1408 ThrownTrident = 88,
1409 TraderLlama = 89,
1410 TropicalFish = 90,
1411 Turtle = 91,
1412 Vex = 92,
1413 Villager = 93,
1414 Vindicator = 94,
1415 WanderingTrader = 95,
1416 Witch = 96,
1417 WitherBoss = 97,
1418 WitherSkeleton = 98,
1419 WitherSkull = 99,
1420 Wolf = 100,
1421 Zoglin = 101,
1422 Zombie = 102,
1423 ZombieHorse = 103,
1424 ZombieVillager = 104,
1425 ZombifiedPiglin = 105,
1426 Player = 106,
1427 FishingHook = 107,
1428#elif PROTOCOL_VERSION > 578 /* > 1.15.2 */
1429 AreaEffectCloud = 0,
1430 ArmorStand = 1,
1431 Arrow = 2,
1432 Bat = 3,
1433 Bee = 4,
1434 Blaze = 5,
1435 Boat = 6,
1436 Cat = 7,
1437 CaveSpider = 8,
1438 Chicken = 9,
1439 Cod = 10,
1440 Cow = 11,
1441 Creeper = 12,
1442 Dolphin = 13,
1443 Donkey = 14,
1444 DragonFireball = 15,
1445 Drowned = 16,
1446 ElderGuardian = 17,
1447 EndCrystal = 18,
1448 EnderDragon = 19,
1449 EnderMan = 20,
1450 Endermite = 21,
1451 Evoker = 22,
1452 EvokerFangs = 23,
1453 ExperienceOrb = 24,
1454 EyeOfEnder = 25,
1455 FallingBlockEntity = 26,
1457 Fox = 28,
1458 Ghast = 29,
1459 Giant = 30,
1460 Guardian = 31,
1461 Hoglin = 32,
1462 Horse = 33,
1463 Husk = 34,
1464 Illusioner = 35,
1465 IronGolem = 36,
1466 ItemEntity = 37,
1467 ItemFrame = 38,
1468 LargeFireball = 39,
1470 LightningBolt = 41,
1471 Llama = 42,
1472 LlamaSpit = 43,
1473 MagmaCube = 44,
1474 Minecart = 45,
1475 MinecartChest = 46,
1477 MinecartFurnace = 48,
1478 MinecartHopper = 49,
1479 MinecartSpawner = 50,
1480 MinecartTNT = 51,
1481 Mule = 52,
1482 MushroomCow = 53,
1483 Ocelot = 54,
1484 Painting = 55,
1485 Panda = 56,
1486 Parrot = 57,
1487 Phantom = 58,
1488 Pig = 59,
1489 Piglin = 60,
1490 Pillager = 61,
1491 PolarBear = 62,
1492 PrimedTnt = 63,
1493 Pufferfish = 64,
1494 Rabbit = 65,
1495 Ravager = 66,
1496 Salmon = 67,
1497 Sheep = 68,
1498 Shulker = 69,
1499 ShulkerBullet = 70,
1500 Silverfish = 71,
1501 Skeleton = 72,
1502 SkeletonHorse = 73,
1503 Slime = 74,
1504 SmallFireball = 75,
1505 SnowGolem = 76,
1506 Snowball = 77,
1507 SpectralArrow = 78,
1508 Spider = 79,
1509 Squid = 80,
1510 Stray = 81,
1511 Strider = 82,
1512 ThrownEgg = 83,
1513 ThrownEnderpearl = 84,
1515 ThrownPotion = 86,
1516 ThrownTrident = 87,
1517 TraderLlama = 88,
1518 TropicalFish = 89,
1519 Turtle = 90,
1520 Vex = 91,
1521 Villager = 92,
1522 Vindicator = 93,
1523 WanderingTrader = 94,
1524 Witch = 95,
1525 WitherBoss = 96,
1526 WitherSkeleton = 97,
1527 WitherSkull = 98,
1528 Wolf = 99,
1529 Zoglin = 100,
1530 Zombie = 101,
1531 ZombieHorse = 102,
1532 ZombieVillager = 103,
1533 ZombifiedPiglin = 104,
1534 Player = 105,
1535 FishingHook = 106,
1536#elif PROTOCOL_VERSION > 498 /* > 1.14.4 */
1537 AreaEffectCloud = 0,
1538 ArmorStand = 1,
1539 Arrow = 2,
1540 Bat = 3,
1541 Bee = 4,
1542 Blaze = 5,
1543 Boat = 6,
1544 Cat = 7,
1545 CaveSpider = 8,
1546 Chicken = 9,
1547 Cod = 10,
1548 Cow = 11,
1549 Creeper = 12,
1550 Donkey = 13,
1551 Dolphin = 14,
1552 DragonFireball = 15,
1553 Drowned = 16,
1554 ElderGuardian = 17,
1555 EndCrystal = 18,
1556 EnderDragon = 19,
1557 EnderMan = 20,
1558 Endermite = 21,
1559 EvokerFangs = 22,
1560 Evoker = 23,
1561 ExperienceOrb = 24,
1562 EyeOfEnder = 25,
1563 FallingBlockEntity = 26,
1565 Fox = 28,
1566 Ghast = 29,
1567 Giant = 30,
1568 Guardian = 31,
1569 Horse = 32,
1570 Husk = 33,
1571 Illusioner = 34,
1572 ItemEntity = 35,
1573 ItemFrame = 36,
1574 LargeFireball = 37,
1576 Llama = 39,
1577 LlamaSpit = 40,
1578 MagmaCube = 41,
1579 Minecart = 42,
1580 MinecartChest = 43,
1582 MinecartFurnace = 45,
1583 MinecartHopper = 46,
1584 MinecartSpawner = 47,
1585 MinecartTNT = 48,
1586 Mule = 49,
1587 MushroomCow = 50,
1588 Ocelot = 51,
1589 Painting = 52,
1590 Panda = 53,
1591 Parrot = 54,
1592 Pig = 55,
1593 Pufferfish = 56,
1594 PigZombie = 57,
1595 PolarBear = 58,
1596 PrimedTnt = 59,
1597 Rabbit = 60,
1598 Salmon = 61,
1599 Sheep = 62,
1600 Shulker = 63,
1601 ShulkerBullet = 64,
1602 Silverfish = 65,
1603 Skeleton = 66,
1604 SkeletonHorse = 67,
1605 Slime = 68,
1606 SmallFireball = 69,
1607 SnowGolem = 70,
1608 Snowball = 71,
1609 SpectralArrow = 72,
1610 Spider = 73,
1611 Squid = 74,
1612 Stray = 75,
1613 TraderLlama = 76,
1614 TropicalFish = 77,
1615 Turtle = 78,
1616 ThrownEgg = 79,
1617 ThrownEnderpearl = 80,
1619 ThrownPotion = 82,
1620 ThrownTrident = 83,
1621 Vex = 84,
1622 Villager = 85,
1623 IronGolem = 86,
1624 Vindicator = 87,
1625 Pillager = 88,
1626 WanderingTrader = 89,
1627 Witch = 90,
1628 WitherBoss = 91,
1629 WitherSkeleton = 92,
1630 WitherSkull = 93,
1631 Wolf = 94,
1632 Zombie = 95,
1633 ZombieHorse = 96,
1634 ZombieVillager = 97,
1635 Phantom = 98,
1636 Ravager = 99,
1637 LightningBolt = 100,
1638 Player = 101,
1639 FishingHook = 102,
1640#elif PROTOCOL_VERSION > 404 /* > 1.13.2 */
1641 AreaEffectCloud = 0,
1642 ArmorStand = 1,
1643 Arrow = 2,
1644 Bat = 3,
1645 Blaze = 4,
1646 Boat = 5,
1647 Cat = 6,
1648 CaveSpider = 7,
1649 Chicken = 8,
1650 Cod = 9,
1651 Cow = 10,
1652 Creeper = 11,
1653 Donkey = 12,
1654 Dolphin = 13,
1655 DragonFireball = 14,
1656 Drowned = 15,
1657 ElderGuardian = 16,
1658 EndCrystal = 17,
1659 EnderDragon = 18,
1660 EnderMan = 19,
1661 Endermite = 20,
1662 EvokerFangs = 21,
1663 Evoker = 22,
1664 ExperienceOrb = 23,
1665 EyeOfEnder = 24,
1666 FallingBlockEntity = 25,
1668 Fox = 27,
1669 Ghast = 28,
1670 Giant = 29,
1671 Guardian = 30,
1672 Horse = 31,
1673 Husk = 32,
1674 Illusioner = 33,
1675 ItemEntity = 34,
1676 ItemFrame = 35,
1677 LargeFireball = 36,
1679 Llama = 38,
1680 LlamaSpit = 39,
1681 MagmaCube = 40,
1682 Minecart = 41,
1683 MinecartChest = 42,
1685 MinecartFurnace = 44,
1686 MinecartHopper = 45,
1687 MinecartSpawner = 46,
1688 MinecartTNT = 47,
1689 Mule = 48,
1690 MushroomCow = 49,
1691 Ocelot = 50,
1692 Painting = 51,
1693 Panda = 52,
1694 Parrot = 53,
1695 Pig = 54,
1696 Pufferfish = 55,
1697 PigZombie = 56,
1698 PolarBear = 57,
1699 PrimedTnt = 58,
1700 Rabbit = 59,
1701 Salmon = 60,
1702 Sheep = 61,
1703 Shulker = 62,
1704 ShulkerBullet = 63,
1705 Silverfish = 64,
1706 Skeleton = 65,
1707 SkeletonHorse = 66,
1708 Slime = 67,
1709 SmallFireball = 68,
1710 SnowGolem = 69,
1711 Snowball = 70,
1712 SpectralArrow = 71,
1713 Spider = 72,
1714 Squid = 73,
1715 Stray = 74,
1716 TraderLlama = 75,
1717 TropicalFish = 76,
1718 Turtle = 77,
1719 ThrownEgg = 78,
1720 ThrownEnderpearl = 79,
1722 ThrownPotion = 81,
1723 ThrownTrident = 82,
1724 Vex = 83,
1725 Villager = 84,
1726 IronGolem = 85,
1727 Vindicator = 86,
1728 Pillager = 87,
1729 WanderingTrader = 88,
1730 Witch = 89,
1731 WitherBoss = 90,
1732 WitherSkeleton = 91,
1733 WitherSkull = 92,
1734 Wolf = 93,
1735 Zombie = 94,
1736 ZombieHorse = 95,
1737 ZombieVillager = 96,
1738 Phantom = 97,
1739 Ravager = 98,
1740 LightningBolt = 99,
1741 Player = 100,
1742 FishingHook = 101,
1743#elif PROTOCOL_VERSION > 340 /* > 1.12.2 */
1744 AreaEffectCloud = 0,
1745 ArmorStand = 1,
1746 Arrow = 2,
1747 Bat = 3,
1748 Blaze = 4,
1749 Boat = 5,
1750 CaveSpider = 6,
1751 Chicken = 7,
1752 Cod = 8,
1753 Cow = 9,
1754 Creeper = 10,
1755 Donkey = 11,
1756 Dolphin = 12,
1757 DragonFireball = 13,
1758 Drowned = 14,
1759 ElderGuardian = 15,
1760 EndCrystal = 16,
1761 EnderDragon = 17,
1762 EnderMan = 18,
1763 Endermite = 19,
1764 EvokerFangs = 20,
1765 Evoker = 21,
1766 ExperienceOrb = 22,
1767 EyeOfEnder = 23,
1768 FallingBlockEntity = 24,
1770 Ghast = 26,
1771 Giant = 27,
1772 Guardian = 28,
1773 Horse = 29,
1774 Husk = 30,
1775 Illusioner = 31,
1776 ItemEntity = 32,
1777 ItemFrame = 33,
1778 LargeFireball = 34,
1780 Llama = 36,
1781 LlamaSpit = 37,
1782 MagmaCube = 38,
1783 Minecart = 39,
1784 MinecartChest = 40,
1786 MinecartFurnace = 42,
1787 MinecartHopper = 43,
1788 MinecartSpawner = 44,
1789 MinecartTNT = 45,
1790 Mule = 46,
1791 MushroomCow = 47,
1792 Ocelot = 48,
1793 Painting = 49,
1794 Parrot = 50,
1795 Pig = 51,
1796 Pufferfish = 52,
1797 PigZombie = 53,
1798 PolarBear = 54,
1799 PrimedTnt = 55,
1800 Rabbit = 56,
1801 Salmon = 57,
1802 Sheep = 58,
1803 Shulker = 59,
1804 ShulkerBullet = 60,
1805 Silverfish = 61,
1806 Skeleton = 62,
1807 SkeletonHorse = 63,
1808 Slime = 64,
1809 SmallFireball = 65,
1810 SnowGolem = 66,
1811 Snowball = 67,
1812 SpectralArrow = 68,
1813 Spider = 69,
1814 Squid = 70,
1815 Stray = 71,
1816 TropicalFish = 72,
1817 Turtle = 73,
1818 ThrownEgg = 74,
1819 ThrownEnderpearl = 75,
1821 ThrownPotion = 77,
1822 Vex = 78,
1823 Villager = 79,
1824 IronGolem = 80,
1825 Vindicator = 81,
1826 Witch = 82,
1827 WitherBoss = 83,
1828 WitherSkeleton = 84,
1829 WitherSkull = 85,
1830 Wolf = 86,
1831 Zombie = 87,
1832 ZombieHorse = 88,
1833 ZombieVillager = 89,
1834 Phantom = 90,
1835 LightningBolt = 91,
1836 Player = 92,
1837 FishingHook = 93,
1838 ThrownTrident = 94,
1839#else // 1.12.2
1840 FishingHook = -3,
1841 Player = -2,
1842 ItemEntity = 1,
1843 ExperienceOrb = 2,
1844 AreaEffectCloud = 3,
1845 ElderGuardian = 4,
1846 WitherSkeleton = 5,
1847 Stray = 6,
1848 ThrownEgg = 7,
1850 Painting = 9,
1851 Arrow = 10,
1852 Snowball = 11,
1853 LargeFireball = 12,
1854 SmallFireball = 13,
1855 ThrownEnderpearl = 14,
1856 EyeOfEnder = 15,
1857 ThrownPotion = 16,
1859 ItemFrame = 18,
1860 WitherSkull = 19,
1861 PrimedTnt = 20,
1862 FallingBlockEntity = 21,
1864 Husk = 23,
1865 SpectralArrow = 24,
1866 ShulkerBullet = 25,
1867 DragonFireball = 26,
1868 ZombieVillager = 27,
1869 SkeletonHorse = 28,
1870 ZombieHorse = 29,
1871 ArmorStand = 30,
1872 Donkey = 31,
1873 Mule = 32,
1874 EvokerFangs = 33,
1875 Evoker = 34,
1876 Vex = 35,
1877 Vindicator = 36,
1878 Illusioner = 37,
1880 Boat = 41,
1881 Minecart = 42,
1882 MinecartChest = 43,
1883 MinecartFurnace = 44,
1884 MinecartTNT = 45,
1885 MinecartHopper = 46,
1886 MinecartSpawner = 47,
1887 Creeper = 50,
1888 Skeleton = 51,
1889 Spider = 52,
1890 Giant = 53,
1891 Zombie = 54,
1892 Slime = 55,
1893 Ghast = 56,
1894 PigZombie = 57,
1895 EnderMan = 58,
1896 CaveSpider = 59,
1897 Silverfish = 60,
1898 Blaze = 61,
1899 MagmaCube = 62,
1900 EnderDragon = 63,
1901 WitherBoss = 64,
1902 Bat = 65,
1903 Witch = 66,
1904 Endermite = 67,
1905 Guardian = 68,
1906 Shulker = 69,
1907 Pig = 90,
1908 Sheep = 91,
1909 Cow = 92,
1910 Chicken = 93,
1911 Squid = 94,
1912 Wolf = 95,
1913 MushroomCow = 96,
1914 SnowGolem = 97,
1915 Ocelot = 98,
1916 IronGolem = 99,
1917 Horse = 100,
1918 Rabbit = 101,
1919 PolarBear = 102,
1920 Llama = 103,
1921 LlamaSpit = 104,
1922 Parrot = 105,
1923 Villager = 120,
1924 EndCrystal = 200,
1925#endif
1927 };
1928
1929#if PROTOCOL_VERSION < 458 /* < 1.14 */
1930 enum class ObjectEntityType
1931 {
1932 None = -1,
1933 Boat = 1,
1934 ItemEntity = 2,
1935 AreaEffectCloud = 3,
1936 PrimedTnt = 50,
1937 EndCrystal = 51,
1938 Arrow = 60,
1939 Snowball = 61,
1940 ThrownEgg = 62,
1941 LargeFireball = 63,
1942 SmallFireball = 64,
1943 ThrownEnderpearl = 65,
1944 WitherSkull = 66,
1945 ShulkerBullet = 67,
1946 LlamaSpit = 68,
1947 FallingBlockEntity = 70,
1948 ItemFrame = 71,
1949 EyeOfEnder = 72,
1950 ThrownPotion = 73,
1952 FireworkRocketEntity = 76,
1953 LeashFenceKnotEntity = 77,
1954 ArmorStand = 78,
1955 EvokerFangs = 79,
1956 FishingHook = 90,
1957 SpectralArrow = 91,
1958 DragonFireball = 93,
1959#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
1960 ThrownTrident = 94,
1961#endif
1963 };
1964#endif
1965}
int GetDataTicksFrozen() const
Definition Entity.cpp:696
void OnSizeUpdated()
Definition Entity.cpp:1936
virtual EntityType GetType() const =0
bool GetOnGround() const
Definition Entity.cpp:843
ProtocolCraft::UUID uuid
Definition Entity.hpp:256
virtual double GetHeightImpl() const
Definition Entity.cpp:2004
void SetDataSilent(const bool data_silent)
Definition Entity.cpp:742
virtual bool IsFlyingMob() const
Definition Entity.cpp:1227
virtual ProtocolCraft::Json::Value Serialize() const
Definition Entity.cpp:1095
void SetDataPose(const Pose data_pose)
Definition Entity.cpp:755
std::map< EquipmentSlot, ProtocolCraft::Slot > equipments
Items on this entity.
Definition Entity.hpp:265
virtual void SetY(const double y_)
Definition Entity.cpp:944
double GetZ() const
Definition Entity.cpp:801
virtual bool IsAbstractChestedHorse() const
Definition Entity.cpp:1200
virtual bool IsWaterAnimal() const
Definition Entity.cpp:1195
void SetEffects(const std::vector< EntityEffect > &effects_)
Definition Entity.cpp:1044
void SetDataAirSupplyId(const int data_air_supply_id)
Definition Entity.cpp:716
void SetDataSharedFlagsIdImpl(const char data_shared_flags_id)
Definition Entity.cpp:1961
Vector3< double > GetSpeed() const
Definition Entity.cpp:819
void SetUUID(const ProtocolCraft::UUID &uuid_)
Definition Entity.cpp:903
std::map< EquipmentSlot, ProtocolCraft::Slot > GetEquipments() const
Definition Entity.cpp:849
Vector3< double > speed
Definition Entity.hpp:260
virtual bool IsAbstractArrow() const
Definition Entity.cpp:1151
virtual bool IsAbstractSkeleton() const
Definition Entity.cpp:1291
virtual bool IsAbstractPiglin() const
Definition Entity.cpp:1268
int GetEntityID() const
Definition Entity.cpp:771
virtual bool IsLocalPlayer() const
Definition Entity.cpp:1136
double GetHeight() const
Definition Entity.cpp:331
std::vector< EntityEffect > effects
Definition Entity.hpp:266
char GetDataSharedFlagsIdImpl() const
Definition Entity.cpp:1951
virtual bool IsRemotePlayer() const
Definition Entity.cpp:1141
bool GetDataSilent() const
Definition Entity.cpp:675
void SetDataPoseImpl(const Pose data_pose)
Definition Entity.cpp:1983
double GetSpeedX() const
Definition Entity.cpp:825
virtual bool IsAbstractBoat() const
Definition Entity.cpp:1345
virtual bool IsAbstractHurtingProjectile() const
Definition Entity.cpp:1205
ProtocolCraft::UUID GetUUID() const
Definition Entity.cpp:777
double GetY() const
Definition Entity.cpp:795
virtual bool IsAbstractSchoolingFish() const
Definition Entity.cpp:1190
void SetSpeed(const Vector3< double > &speed_)
Definition Entity.cpp:1008
virtual bool IsHangingEntity() const
Definition Entity.cpp:1242
bool GetAreRenderedFacesUpToDate() const
Definition Entity.cpp:889
virtual void SetMetadataValue(const int index, const std::any &value)
Definition Entity.cpp:622
virtual bool IsSpellcasterIllager() const
Definition Entity.cpp:1215
virtual bool IsBlockAttachedEntity() const
Definition Entity.cpp:1338
static std::shared_ptr< Entity > CreateEntity(const EntityType type)
Definition Entity.cpp:1382
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:62
AABB GetCollider() const
Definition Entity.cpp:319
static const std::array< std::string, metadata_count > metadata_names
Definition Entity.hpp:61
bool are_rendered_faces_up_to_date
Definition Entity.hpp:275
virtual double GetWidthImpl() const
Definition Entity.cpp:1999
virtual void SetZ(const double z_)
Definition Entity.cpp:960
void SetEquipment(const EquipmentSlot slot, const ProtocolCraft::Slot &item)
Definition Entity.cpp:1038
std::vector< Renderer::Face > faces
Definition Entity.hpp:273
virtual bool IsLivingEntity() const
Definition Entity.cpp:1146
virtual bool IsChestBoat() const
Definition Entity.cpp:1365
double GetWidth() const
Definition Entity.cpp:325
virtual ~Entity()
Definition Entity.cpp:313
virtual bool IsPatrollingMonster() const
Definition Entity.cpp:1319
virtual bool IsProjectile() const
Definition Entity.cpp:1221
int GetDataAirSupplyId() const
Definition Entity.cpp:649
std::vector< EntityEffect > GetEffects() const
Definition Entity.cpp:861
virtual bool IsAbstractMinecart() const
Definition Entity.cpp:1252
virtual bool IsDisplay() const
Definition Entity.cpp:1172
void SetSpeedY(const double speed_y_)
Definition Entity.cpp:1020
virtual bool IsAbstractMinecartContainer() const
Definition Entity.cpp:1257
void SetDataCustomName(const std::optional< ProtocolCraft::Chat > &data_custom_name)
Definition Entity.cpp:723
virtual bool IsAmbientCreature() const
Definition Entity.cpp:1161
virtual bool IsFireball() const
Definition Entity.cpp:1247
Pose GetDataPose() const
Definition Entity.cpp:688
std::shared_mutex entity_mutex
Definition Entity.hpp:253
void SetOnGround(const bool on_ground_)
Definition Entity.cpp:1032
virtual bool IsAnimal() const
Definition Entity.cpp:1156
std::vector< Renderer::Face > GetFaces(const bool reset_uptodate_status)
Definition Entity.cpp:868
void SetSpeedX(const double speed_x_)
Definition Entity.cpp:1014
virtual bool IsAbstractFish() const
Definition Entity.cpp:1279
virtual bool IsAgeableMob() const
Definition Entity.cpp:1308
virtual void SetX(const double x_)
Definition Entity.cpp:928
virtual bool IsAbstractVillager() const
Definition Entity.cpp:1302
virtual void InitializeFaces()
Definition Entity.cpp:1854
virtual bool IsThrowableProjectile() const
Definition Entity.cpp:1325
virtual bool IsAbstractWindCharge() const
Definition Entity.cpp:1331
AABB GetColliderImpl() const
Definition Entity.cpp:1992
void SetDataSharedFlagsId(const char data_shared_flags_id)
Definition Entity.cpp:704
char GetDataSharedFlagsId() const
Definition Entity.cpp:637
virtual bool IsMob() const
Definition Entity.cpp:1210
virtual void SetYaw(const float yaw_)
Definition Entity.cpp:976
virtual bool IsPathfinderMob() const
Definition Entity.cpp:1313
ProtocolCraft::Slot GetEquipment(const EquipmentSlot slot) const
Definition Entity.cpp:855
void SetDataCustomNameVisible(const bool data_custom_name_visible)
Definition Entity.cpp:736
virtual bool IsVehicle() const
Definition Entity.cpp:1179
double GetSpeedY() const
Definition Entity.cpp:831
double GetSpeedZ() const
Definition Entity.cpp:837
virtual std::string GetName() const =0
Pose GetDataPoseImpl() const
Definition Entity.cpp:1978
virtual bool IsRaider() const
Definition Entity.cpp:1285
virtual void SetPitch(const float pitch_)
Definition Entity.cpp:992
virtual bool IsThrowableItemProjectile() const
Definition Entity.cpp:1296
void SetEntityID(const int entity_id_)
Definition Entity.cpp:897
virtual bool IsMonster() const
Definition Entity.cpp:1166
virtual bool IsTamableAnimal() const
Definition Entity.cpp:1185
void SetDataNoGravity(const bool data_no_gravity)
Definition Entity.cpp:748
bool GetDataCustomNameVisible() const
Definition Entity.cpp:669
virtual bool IsAbstractIllager() const
Definition Entity.cpp:1274
virtual bool IsAbstractHorse() const
Definition Entity.cpp:1232
std::map< std::string, std::any > metadata
Definition Entity.hpp:268
Vector3< double > position
Definition Entity.hpp:257
virtual bool IsAbstractChestBoat() const
Definition Entity.cpp:1350
void AddEffect(const EntityEffect &effect)
Definition Entity.cpp:1066
virtual bool IsChestRaft() const
Definition Entity.cpp:1370
virtual bool IsAbstractGolem() const
Definition Entity.cpp:1237
float GetYaw() const
Definition Entity.cpp:807
virtual bool IsAgeableWaterCreature() const
Definition Entity.cpp:1355
double GetX() const
Definition Entity.cpp:789
bool GetDataNoGravity() const
Definition Entity.cpp:681
void SetAreRenderedFacesUpToDate(const bool are_rendered_faces_up_to_date_)
Definition Entity.cpp:1087
Vector3< double > GetPosition() const
Definition Entity.cpp:783
void SetSpeedZ(const double speed_z_)
Definition Entity.cpp:1026
static constexpr int metadata_count
Definition Entity.hpp:55
std::vector< FaceDescriptor > face_descriptors
Definition Entity.hpp:272
std::optional< ProtocolCraft::Chat > GetDataCustomName() const
Definition Entity.cpp:656
virtual bool IsBoat() const
Definition Entity.cpp:1360
void LoadMetadataFromRawArray(const std::vector< unsigned char > &data)
Definition Entity.cpp:338
virtual bool IsRaft() const
Definition Entity.cpp:1375
virtual bool IsShoulderRidingEntity() const
Definition Entity.cpp:1262
float GetPitch() const
Definition Entity.cpp:813
void RemoveEffect(const EntityEffectType type)
Definition Entity.cpp:1050
virtual void SetPosition(const Vector3< double > &position_)
Definition Entity.cpp:909
void SetDataTicksFrozen(const int data_ticks_frozen)
Definition Entity.cpp:763
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
EquipmentSlot
Definition Enums.hpp:276
EntityEffectType
Definition Enums.hpp:315
EntitySharedFlagsId
Definition Entity.hpp:40
std::array< unsigned char, 16 > UUID
std::chrono::steady_clock::time_point end
Definition Entity.hpp:36
unsigned char amplifier
Definition Entity.hpp:35
EntityEffectType type
Definition Entity.hpp:34