pub struct MinecraftEntityId(pub i32);
Expand description
An entity ID used by Minecraft.
These IDs are picked by the server. Some server softwares (like Bungeecord) may pick entity IDs per-player, so you should avoid relying on them for identifying IDs (especially if you’re using a shared world – i.e. a swarm).
You might find Entity
more useful, since that’s an ID decided by us that
is likely to be correct across shared worlds. You could also use the
EntityUuid
from azalea_entity
, that one is unlikely to change even
across server restarts.
This serializes as a i32. Usually it’s a VarInt in the protocol, but not
always. If you do need it to serialize as a VarInt, make sure to use use the
#[var]
attribute.
Tuple Fields§
§0: i32
Trait Implementations§
Source§impl AzaleaRead for MinecraftEntityId
impl AzaleaRead for MinecraftEntityId
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError>
Source§impl AzaleaReadVar for MinecraftEntityId
impl AzaleaReadVar for MinecraftEntityId
fn azalea_read_var(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError>
Source§impl AzaleaWrite for MinecraftEntityId
impl AzaleaWrite for MinecraftEntityId
Source§impl AzaleaWriteVar for MinecraftEntityId
impl AzaleaWriteVar for MinecraftEntityId
Source§impl Clone for MinecraftEntityId
impl Clone for MinecraftEntityId
Source§fn clone(&self) -> MinecraftEntityId
fn clone(&self) -> MinecraftEntityId
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Component for MinecraftEntityId
impl Component for MinecraftEntityId
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
A constant indicating the storage type used for this component.
Source§fn register_required_components(
requiree: ComponentId,
components: &mut Components,
storages: &mut Storages,
required_components: &mut RequiredComponents,
inheritance_depth: u16,
)
fn register_required_components( requiree: ComponentId, components: &mut Components, storages: &mut Storages, required_components: &mut RequiredComponents, inheritance_depth: u16, )
Registers required components.
Source§fn register_component_hooks(hooks: &mut ComponentHooks)
fn register_component_hooks(hooks: &mut ComponentHooks)
Called when registering this component, allowing mutable access to its [
ComponentHooks
].Source§impl Debug for MinecraftEntityId
impl Debug for MinecraftEntityId
Source§impl Default for MinecraftEntityId
impl Default for MinecraftEntityId
Source§fn default() -> MinecraftEntityId
fn default() -> MinecraftEntityId
Returns the “default value” for a type. Read more
Source§impl Deref for MinecraftEntityId
impl Deref for MinecraftEntityId
Source§impl DerefMut for MinecraftEntityId
impl DerefMut for MinecraftEntityId
Source§impl<'de> Deserialize<'de> for MinecraftEntityId
impl<'de> Deserialize<'de> for MinecraftEntityId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MinecraftEntityId
impl Display for MinecraftEntityId
Source§impl Hash for MinecraftEntityId
impl Hash for MinecraftEntityId
Source§impl PartialEq for MinecraftEntityId
impl PartialEq for MinecraftEntityId
Source§impl Serialize for MinecraftEntityId
impl Serialize for MinecraftEntityId
impl Copy for MinecraftEntityId
impl Eq for MinecraftEntityId
impl IsEnabled for MinecraftEntityId
impl StructuralPartialEq for MinecraftEntityId
Auto Trait Implementations§
impl Freeze for MinecraftEntityId
impl RefUnwindSafe for MinecraftEntityId
impl Send for MinecraftEntityId
impl Sync for MinecraftEntityId
impl Unpin for MinecraftEntityId
impl UnwindSafe for MinecraftEntityId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId), )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
§fn register_required_components(
components: &mut Components,
storages: &mut Storages,
required_components: &mut RequiredComponents,
)
fn register_required_components( components: &mut Components, storages: &mut Storages, required_components: &mut RequiredComponents, )
Registers components that are required by the components in this [
Bundle
].§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Gets this [
Bundle
]’s component ids. This will be None
if the component has not been registered.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.