Struct entmet_lib::entities::entity::Entity

source ·
pub struct Entity {
    pub status: Mask<EntityState>,
    pub air_ticks: i32,
    pub custom_name: Option<TextComponent>,
    pub custom_name_visible: bool,
    pub silent: bool,
    pub no_gravity: bool,
    pub pose: PoseEnum,
    pub ticks_frozen_in_powdered_snow: i32,
}
Expand description

An struct for a basic Entity

Fields§

§status: Mask<EntityState>

The states of the entity

§air_ticks: i32

The amount of ticks in the air

§custom_name: Option<TextComponent>

The optional custom name of the entity

§custom_name_visible: bool

Whether the custom name of the entity is visible

§silent: bool

Wether the entity is silent or not

§no_gravity: bool

Wether gravity applies to the entity or not

§pose: PoseEnum

The pose of the enum

§ticks_frozen_in_powdered_snow: i32

The amount of ticks that the entity is freezing in powdered snow

Implementations§

source§

impl Entity

source

pub fn new( status: Mask<EntityState>, air_ticks: i32, custom_name: Option<TextComponent>, custom_name_visible: bool, silent: bool, no_gravity: bool, pose: PoseEnum, ticks_frozen_in_powdered_snow: i32 ) -> Self

Function to create a new instance of Entity

§Arguments

status - An instance of Mask holding EntityState, storing the states of the entity air_ticks - The amount of ticks in the air custom_name - Optional custom name of the entity custom_name_visible - Whether the custom name should be visible silent - Whether the entity is silent or not no_gravity - Whether gravity should apply to the entity or not pose - The pose of the entity tickts_frozen_in_powdered_snow - The amount that the player is freezing in powdered snow

Trait Implementations§

source§

impl Clone for Entity

source§

fn clone(&self) -> Entity

Returns a copy 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 Entity

source§

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

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

impl Default for Entity

source§

fn default() -> Self

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

impl PartialEq for Entity

source§

fn eq(&self, other: &Entity) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Entity

Auto Trait Implementations§

§

impl Freeze for Entity

§

impl RefUnwindSafe for Entity

§

impl Send for Entity

§

impl Sync for Entity

§

impl Unpin for Entity

§

impl UnwindSafe for Entity

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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,

§

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>,

§

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>,

§

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.