pub struct Base {Show 20 fields
pub persistent: bool,
pub size: Size,
pub bb: BoundingBox,
pub pos: DVec3,
pub vel: DVec3,
pub look: Vec2,
pub lifetime: u32,
pub eye_height: f32,
pub can_pickup: bool,
pub no_clip: bool,
pub on_ground: bool,
pub in_water: bool,
pub in_lava: bool,
pub fall_distance: f32,
pub fire_time: u32,
pub air_time: u32,
pub hurt: Vec<Hurt>,
pub rider_id: Option<u32>,
pub bobber_id: Option<u32>,
pub rand: JavaRandom,
}Expand description
The base data common to all entities.
Fields§
§persistent: boolTell if this entity is persistent or not. A persistent entity is saved with its chunk, but non-persistent entities are no saved. For example, all player entities are typically non-persistent because these are not real entities. Some entities cannot be persistent as they are not supported by the Notchian serialization.
size: SizeThe last size that was used when recomputing the bounding box based on the
position, we keep it in order to check that the bounding box don’t shift too far
from it because of rounding errors, and also to keep the height center. This is
updated with the bounding box by tick_base method when entity isn’t coherent.
bb: BoundingBoxThe bounding box is defining the actual position from the size of the entity, the
actual position of the entity is derived from it. This is recomputed with the size
by tick_base method when entity isn’t coherent.
pos: DVec3The current entity position, it is derived from the bounding box and size, it can
be forced by setting it and then calling resize on entity.
vel: DVec3True if an entity pos event should be sent after update. The current entity velocity.
look: Vec2Yaw a pitch angles of this entity’s look. These are in radians with no range guarantee, although this will often be normalized in 2pi range. The yaw angle in Minecraft is set to zero when pointing toward PosZ, and then rotate clockwise to NegX, NegZ and then PosX.
Yaw is X and pitch is Y.
lifetime: u32Lifetime of the entity since it was spawned in the world, it increase at every world tick.
eye_height: f32Height of the eyes, this is an Y offset from the position.
can_pickup: boolSet to true when the entity is able to pickup surrounding items and arrows on ground, if so a pickup event is triggered, but the item or arrow is not actually picked up, it’s up to the event listener to decide. Disabled by default.
no_clip: boolNo clip is used to disable collision check when moving the entity, if no clip is false, then the entity will be constrained by bounding box in its way.
on_ground: boolIs this entity currently on ground.
in_water: boolIs this entity in water.
in_lava: boolIs this entity in lava.
fall_distance: f32Total fall distance, will be used upon contact to calculate damages to deal.
fire_time: u32Remaining fire ticks.
air_time: u32Remaining air ticks to breathe.
hurt: Vec<Hurt>A list of hurts to apply to the entity.
rider_id: Option<u32>If this entity is ridden, this contains its entity id.
bobber_id: Option<u32>If this entity has thrown a bobber for fishing, this contains its entity id.
rand: JavaRandomThe random number generator used for this entity.