diff options
Diffstat (limited to 'azalea/src/entity_ref/shared_impls.rs')
| -rw-r--r-- | azalea/src/entity_ref/shared_impls.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/azalea/src/entity_ref/shared_impls.rs b/azalea/src/entity_ref/shared_impls.rs index 1dafbde2..9ef396a0 100644 --- a/azalea/src/entity_ref/shared_impls.rs +++ b/azalea/src/entity_ref/shared_impls.rs @@ -1,6 +1,6 @@ use azalea_core::position::Vec3; use azalea_entity::{ - Attributes, Dead, EntityUuid, Position, dimensions::EntityDimensions, metadata::Health, + Attributes, Dead, EntityUuid, Physics, Position, dimensions::EntityDimensions, metadata::Health, }; use azalea_world::{InstanceName, MinecraftEntityId}; use uuid::Uuid; @@ -191,4 +191,16 @@ impl_entity_functions! { pub fn exists(&self) -> bool { self.try_query_self::<Option<&MinecraftEntityId>, _>(|entity_id| entity_id.is_some()).unwrap_or(false) } + + Client: + /// Returns the complete [`Physics`] data for this client, including velocity, bounding box, + /// collisions, etc. + EntityRef: + /// Returns the complete [`Physics`] data for this entity, including velocity, bounding box, + /// collisions, etc. + /// + /// Also see [`Client::physics`]. + pub fn physics(&self) -> Physics { + self.component::<Physics>().clone() + } } |
