Skip to main content

EntityType

Struct EntityType 

Source
pub struct EntityType {
Show 21 fields pub key: Identifier, pub client_tracking_range: i32, pub update_interval: i32, pub track_deltas: bool, pub dimensions: EntityDimensions, pub fixed: bool, pub mob_category: MobCategory, pub fire_immune: bool, pub summonable: bool, pub allowed_in_peaceful: bool, pub can_spawn_far_from_player: bool, pub can_serialize: bool, pub only_op_can_set_nbt: bool, pub is_abstract_boat: bool, pub is_abstract_minecart: bool, pub is_projectile: bool, pub is_abstract_arrow: bool, pub is_abstract_horse: bool, pub is_abstract_nautilus: bool, pub flags: EntityFlags, pub default_attributes: &'static [(&'static str, f64)],
}

Fields§

§key: Identifier§client_tracking_range: i32§update_interval: i32§track_deltas: bool

Whether vanilla ServerEntity tracks velocity deltas for this type.

§dimensions: EntityDimensions

Default entity dimensions.

§fixed: bool

If true, dimensions cannot be scaled.

§mob_category: MobCategory

Mob category for spawn classification.

§fire_immune: bool

Whether this entity is immune to fire damage.

§summonable: bool

Whether this entity can be summoned via commands.

§allowed_in_peaceful: bool

Whether this entity type is allowed to exist in Peaceful difficulty.

§can_spawn_far_from_player: bool

Whether this entity can spawn far from players.

§can_serialize: bool

Whether this entity type can be serialized to disk. Set to false for transient entities (lightning, fishing hooks, players).

§only_op_can_set_nbt: bool

Whether only server operators may set this entity’s data via a spawn item’s ENTITY_DATA component. Mirrors vanilla EntityType.onlyOpCanSetNbt.

§is_abstract_boat: bool

Whether vanilla class hierarchy makes this entity an AbstractBoat.

§is_abstract_minecart: bool

Whether vanilla class hierarchy makes this entity an AbstractMinecart.

§is_projectile: bool

Whether vanilla class hierarchy makes this entity a Projectile.

§is_abstract_arrow: bool

Whether vanilla class hierarchy makes this entity an AbstractArrow.

§is_abstract_horse: bool

Whether vanilla class hierarchy makes this entity an AbstractHorse.

§is_abstract_nautilus: bool

Whether vanilla class hierarchy makes this entity an AbstractNautilus.

§flags: EntityFlags

Behavioral flags for collision and interaction.

§default_attributes: &'static [(&'static str, f64)]

Default attribute base values for this entity type Empty for entities that don’t have attributes (projectiles, items, displays, etc.)

Trait Implementations§

Source§

impl Debug for EntityType

Source§

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

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

impl Eq for EntityType

Source§

impl PartialEq for EntityType

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 RegistryEntry for EntityType

Source§

fn key(&self) -> &Identifier

Source§

fn try_id(&self) -> Option<usize>

Source§

fn id(&self) -> usize

Panics Read more
Source§

impl RegistryHolderSetEntry for EntityType

Source§

const REGISTRY_NAME: &'static str = "entity type"

Human-readable registry name used in codec errors.
Source§

fn holder_set_by_id(id: usize) -> Option<&'static Self>

Looks up an entry by its protocol registry ID.
Source§

fn holder_set_by_key(key: &Identifier) -> Option<&'static Self>

Looks up an entry by its registry key.
Source§

fn holder_set_tag_exists(tag: &Identifier) -> bool

Returns whether the registry contains this tag.
Source§

fn holder_set_tag_contains(entry: &'static Self, tag: &Identifier) -> bool

Returns whether an entry belongs to this tag.

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoShared for T

Source§

fn into_shared(self) -> Arc<Mutex<RawMutex, Self>>

Wraps this value in an Arc<SyncMutex<>>
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<E> StatValueRegistryEntry for E
where E: RegistryEntry + Send + Sync,

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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