Module entity_types

Source
Available on crate features 1.21.7 and entities and latest only.
Expand description

Entity types for Minecraft 1.21.7.

The structs in this module represent the various superclasses of Entity, including those that don’t have a corresponding EntityType specified. Each of them can add additional data to the NBT which all its subclasses will also have. In order to replicate this inheritance structure, every struct in this module has a parent field which holds an instance of the struct that represents the superclass. They all eventually go down to Entity, which is the only struct wihout a parent, as it is the base class of all the others. During (de)serialization this structure is flattened to one level. This is best described with an example. Consider the following structure:

struct A { a: i32 }
struct B { b: f64, parent: A }
struct C { c: bool, parent: B }

During (de)serialization an instance of C would be treated as if it was defined as:

struct C { a: i32, b: f64, c: bool }

The same goes for B which would be seen as

struct B { a: i32, b: f64 }

Structs§

AbstractArrow
AbstractBoat
AbstractChestBoat
AbstractChestedHorse
AbstractCow
AbstractFish
AbstractGolem
AbstractHorse
AbstractHurtingProjectile
AbstractIllager
AbstractMinecart
AbstractMinecartContainer
AbstractPiglin
AbstractSchoolingFish
AbstractSkeleton
AbstractThrownPotion
AbstractVillager
AbstractWindCharge
AgeableMob
AgeableWaterCreature
Allay
AmbientCreature
Animal
AreaEffectCloud
Armadillo
ArmorStand
Arrow
Axolotl
Bat
Bee
Blaze
BlockAttachedEntity
BlockDisplay
Boat
Bogged
Breeze
BreezeWindCharge
Camel
Cat
CaveSpider
ChestBoat
ChestRaft
Chicken
Cod
Cow
Creaking
Creeper
Display
Dolphin
Donkey
DragonFireball
Drowned
ElderGuardian
EndCrystal
EnderDragon
EnderMan
Endermite
Entity
Evoker
EvokerFangs
ExperienceOrb
EyeOfEnder
FallingBlockEntity
Fireball
FireworkRocketEntity
FishingHook
Fox
Frog
Ghast
Giant
GlowItemFrame
GlowSquid
Goat
Guardian
HangingEntity
HappyGhast
Hoglin
Horse
Husk
Illusioner
Interaction
IronGolem
ItemDisplay
ItemEntity
ItemFrame
LargeFireball
LeashFenceKnotEntity
LightningBolt
LivingEntity
Llama
LlamaSpit
MagmaCube
Marker
Minecart
MinecartChest
MinecartCommandBlock
MinecartFurnace
MinecartHopper
MinecartSpawner
MinecartTNT
Mob
Monster
Mule
MushroomCow
Ocelot
OminousItemSpawner
Painting
Panda
Parrot
PathfinderMob
PatrollingMonster
Phantom
Pig
Piglin
PiglinBrute
Pillager
PolarBear
PrimedTnt
Projectile
Pufferfish
Rabbit
Raft
Raider
Ravager
Salmon
Sheep
ShoulderRidingEntity
Shulker
ShulkerBullet
Silverfish
Skeleton
SkeletonHorse
Slime
SmallFireball
Sniffer
SnowGolem
Snowball
SpectralArrow
SpellcasterIllager
Spider
Squid
Stray
Strider
Tadpole
TamableAnimal
TextDisplay
ThrowableItemProjectile
ThrowableProjectile
ThrownEgg
ThrownEnderpearl
ThrownExperienceBottle
ThrownLingeringPotion
ThrownSplashPotion
ThrownTrident
TraderLlama
TropicalFish
Turtle
VehicleEntity
Vex
Villager
Vindicator
WanderingTrader
Warden
WaterAnimal
WindCharge
Witch
WitherBoss
WitherSkeleton
WitherSkull
Wolf
Zoglin
Zombie
ZombieHorse
ZombieVillager
ZombifiedPiglin