aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/entity_ref/mod.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-06 06:34:19 -0500
committermat <git@matdoes.dev>2026-01-06 06:34:19 -0500
commitfdbcfaab4813da928f9f27e119d4951088c3a853 (patch)
tree19f33692f882ada386f8b6aea1e1a195a905e286 /azalea/src/entity_ref/mod.rs
parent9c2c7c3497a74e80d7186fdcd97ce2518520faa6 (diff)
downloadazalea-drasl-fdbcfaab4813da928f9f27e119d4951088c3a853.tar.xz
add a few more convenience functions and update some docs
Diffstat (limited to 'azalea/src/entity_ref/mod.rs')
-rw-r--r--azalea/src/entity_ref/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea/src/entity_ref/mod.rs b/azalea/src/entity_ref/mod.rs
index 2f49d975..d604fe00 100644
--- a/azalea/src/entity_ref/mod.rs
+++ b/azalea/src/entity_ref/mod.rs
@@ -132,4 +132,15 @@ impl EntityRef {
pub fn interact(&self) {
self.client.entity_interact(self.entity);
}
+
+ /// Look at this entity from the client that created the `EntityRef`.
+ pub fn look_at(&self) {
+ self.client.look_at(self.eye_position());
+ }
+
+ /// Returns the distance between the client's feet position and this
+ /// entity's feet position.
+ pub fn distance_to_client(&self) -> f64 {
+ self.position().distance_to(self.client.position())
+ }
}