pub struct VanillaEntitySize {
pub name: &'static str,
pub registry_id: i32,
pub spawn: &'static str,
pub object_types: &'static [(i32, i32)],
pub targeting_margin: f32,
pub fixed: bool,
pub registered: Option<(f32, f32)>,
pub variants: &'static [EntityVariant],
pub poses: &'static [(&'static str, EntityDimensions)],
}Expand description
Vanilla sizes of one entity type, measured by the oracle on the client, spawned the way the
client spawns it from its packet, then metadata-dependent variants applied like the client does
(oracle/README.md, “entity_sizes.jsonl.gz”).
Boxes: EntityDimensions::bounding_box is the centred box vanilla builds on spawn and every
position update. Hanging entities (paintings, item frames) build their box from facing and motive
instead, and vanilla’s resize keeps the old min corner until the next position update.
Fields§
§name: &'static strName: 1.8 legacy registry name ("Zombie", "PigZombie", "Player"), 1.16 registry path
("zombie", "player").
registry_id: i32Vanilla registry id (1.8 EntityType id = the spawn-mob type for mobs; 1.16 registry id);
-1 when the type has none (1.8 players, lightning, fishing bobber) or no client instance.
spawn: &'static str1.8 spawn packet kind: "mob", "object", "xp_orb", "painting", "global",
"player"; empty for 1.16.
object_types: &'static [(i32, i32)]1.8 spawn-object packet (type, data) pairs that create this entity (minecart kinds share
type 10 with different data).
targeting_margin: f32Extra growth of the box when picking entities with the crosshair (getTargetingMargin).
fixed: bool1.16 EntityDimensions.fixed (not scaled for babies); false in 1.8.
registered: Option<(f32, f32)>1.16 registered type dimensions (width, height); None in 1.8.
variants: &'static [EntityVariant]Measured variants, "default" first.
poses: &'static [(&'static str, EntityDimensions)]1.16 player: dimensions per pose ("standing", "crouching", "swimming", …).
Implementations§
Source§impl VanillaEntitySize
impl VanillaEntitySize
Sourcepub fn variant(&self, name: &str) -> Option<&'static EntityVariant>
pub fn variant(&self, name: &str) -> Option<&'static EntityVariant>
A measured variant by name.
Sourcepub fn default_dimensions(&self) -> Option<EntityDimensions>
pub fn default_dimensions(&self) -> Option<EntityDimensions>
The size right after spawning (None for 1.16 types without a client instance; use
VanillaEntitySize::registered).
Sourcepub fn baby(&self) -> Option<EntityDimensions>
pub fn baby(&self) -> Option<EntityDimensions>
The "baby" variant as the client applies it, for types that have one.
Sourcepub fn pose(&self, name: &str) -> Option<EntityDimensions>
pub fn pose(&self, name: &str) -> Option<EntityDimensions>
1.16 player dimensions for a pose.