Living

Struct Living 

Source
pub struct Living {
Show 14 fields pub artificial: bool, pub health: u16, pub hurt_last_damage: u16, pub hurt_time: u16, pub attack_time: u16, pub death_time: u16, pub accel_strafing: f32, pub accel_forward: f32, pub yaw_velocity: f32, pub jumping: bool, pub look_target: Option<LookTarget>, pub attack_target: Option<u32>, pub path: Option<Path>, pub wander_time: u16,
}
Expand description

The data common to all living entities.

Fields§

§artificial: bool

Set to true if an entity is artificial, as opposed to natural. If not artificial, an entity is despawned when too far from the closest player (maximum distance of 128.0 blocks).

§health: u16

The health.

§hurt_last_damage: u16

The last damage inflicted to the entity during hurt_time, this is used to only damage for the maximum damage inflicted while hurt_time is not zero.

§hurt_time: u16

Hurt countdown, read hurt_damage documentation.

§attack_time: u16

TBD.

§death_time: u16

The death timer, increasing each tick when no health, after 20 ticks the entity is definitely removed from the world.

§accel_strafing: f32

The strafing acceleration.

§accel_forward: f32

The forward acceleration.

§yaw_velocity: f32

Velocity of the look’s yaw axis.

§jumping: bool

True if this entity is trying to jump.

§look_target: Option<LookTarget>

If this entity is looking at another one.

§attack_target: Option<u32>

If this entity is attacking another one.

§path: Option<Path>

The path this creature needs to follow.

§wander_time: u16

This timer is used on entities that are wandering too far from players or that take hurt damages. This is only used on entities that are AI ticked and on non persistent living entities. When this time reaches 600 and there are players in the 128.0 block distance, then this entity has 1/800 chance of despawning.

Trait Implementations§

Source§

impl Clone for Living

Source§

fn clone(&self) -> Living

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Living

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Living

Source§

fn default() -> Living

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Living

§

impl RefUnwindSafe for Living

§

impl Send for Living

§

impl Sync for Living

§

impl Unpin for Living

§

impl UnwindSafe for Living

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more