Skip to main content

Entity

Struct Entity 

Source
pub struct Entity {
    pub uuid: String,
}
Expand description

An entity, by its uuid: every action whose first field is uuid.

Fields§

§uuid: String

Implementations§

Source§

impl Entity

Source

pub fn new(uuid: impl Into<String>) -> Self

Source§

impl Entity

Source

pub fn teleport(&self, pos: impl Arg<Point>) -> bool

Moves the entity in its dimension.

Source§

impl Entity

Source

pub fn teleport_to_dim( &self, dim: impl Arg<String>, pos: impl Arg<Point>, ) -> bool

Moves the entity to pos in dim.

Source§

impl Entity

Source

pub fn position(&self) -> Option<Point>

The entity’s position.

Source§

impl Entity

Source

pub fn rotation(&self) -> Option<Rotation>

Which way the entity faces.

Source§

impl Entity

Source

pub fn velocity(&self) -> Option<Point>

The entity’s velocity.

Source§

impl Entity

Source

pub fn set_velocity(&self, velocity: impl Arg<Point>) -> bool

Sets the entity’s velocity.

Source§

impl Entity

Source

pub fn add_velocity(&self, velocity: impl Arg<Point>) -> bool

Adds to the entity’s velocity.

Source§

impl Entity

Source

pub fn health(&self) -> Option<f64>

A living entity’s health.

Source§

impl Entity

Source

pub fn set_health(&self, health: impl Arg<f64>) -> bool

Sets a living entity’s health.

Source§

impl Entity

Source

pub fn kill(&self) -> bool

Kills the entity.

Source§

impl Entity

Source

pub fn add_effect( &self, effect: impl Arg<String>, duration: impl Arg<i32>, amplifier: impl Arg<u8>, particles: impl Arg<bool>, ) -> bool

Gives the entity a mob effect.

Source§

impl Entity

Source

pub fn remove_effect(&self, effect: impl Arg<String>) -> bool

Takes a mob effect off the entity.

Source§

impl Entity

Source

pub fn clear_effects(&self) -> bool

Takes every mob effect off the entity.

Source§

impl Entity

Source

pub fn nbt(&self) -> Option<String>

The entity’s data as SNBT.

Source§

impl Entity

Source

pub fn set_nbt(&self, snbt: impl Arg<String>) -> bool

Merges snbt into the entity’s data.

Source§

impl Entity

Source

pub fn attribute_base(&self, attribute: impl Arg<String>) -> Option<f64>

An attribute’s base value.

Source§

impl Entity

Source

pub fn set_attribute_base( &self, attribute: impl Arg<String>, value: impl Arg<f64>, ) -> bool

Sets an attribute’s base value.

Source§

impl Entity

Source

pub fn attribute_value(&self, attribute: impl Arg<String>) -> Option<f64>

An attribute’s value with its modifiers.

Source§

impl Entity

Source

pub fn info(&self) -> Option<EntityInfo>

The entity’s state.

Source§

impl Entity

Source

pub fn damage( &self, amount: impl Arg<f32>, damage_type: impl Arg<String>, attacker: impl Arg<String>, ) -> bool

Hurts the entity.

Source§

impl Entity

Source

pub fn set_fire_ticks(&self, ticks: impl Arg<i32>) -> bool

Sets the entity on fire for ticks.

Source§

impl Entity

Source

pub fn vehicle(&self) -> Option<String>

The uuid of what the entity rides.

Source§

impl Entity

Source

pub fn passengers(&self) -> Vec<String>

The uuids riding the entity.

Source§

impl Entity

Source

pub fn dismount(&self) -> bool

Gets the entity off what it rides.

Source§

impl Entity

Source

pub fn set_fall_distance(&self, distance: impl Arg<f32>) -> bool

Sets how far the entity has fallen.

Source§

impl Entity

Source

pub fn grant(&self, id: impl Arg<String>) -> bool

Grants advancement id to a player.

Source§

impl Entity

Source

pub fn done(&self, id: impl Arg<String>) -> bool

Whether a player has advancement id.

Source§

impl Entity

Source

pub fn entity_stack(&self) -> Option<Stack>

An item entity’s stack.

Source§

impl Entity

Source

pub fn set_entity_stack( &self, item: impl Arg<String>, count: impl Arg<u32>, snbt: impl Arg<String>, ) -> bool

Sets an item entity’s stack.

Source§

impl Entity

Source

pub fn body_track(&self, on: impl Arg<bool>) -> bool

Asks the mods about entity uuid’s body each frame (on) or not.

Source§

impl Entity

Source

pub fn set_dimensions( &self, width: impl Arg<f32>, height: impl Arg<f32>, eye: impl Arg<f32>, ) -> bool

This client’s side of an entity’s size (width < 0: vanilla’s).

Trait Implementations§

Source§

impl Clone for Entity

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Eq for Entity

Source§

impl Hash for Entity

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Entity

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Entity

Auto Trait Implementations§

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

Source§

fn arg(self) -> T

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

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

fn try_from(value: U) -> Result<T, !>

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.