From e74ed047dbaf3877db4a89a2d589e992abd0bb11 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 14 Aug 2025 20:40:13 -0500 Subject: Sneaking (#237) * start implementing sneaking * fix horizontal_collision being inverted and cleanup * clippy * change dimensions and eye height based on pose * proper support for automatically crouching in certain cases * fix anticheat issues * add line to changelog and update a comment --- azalea/examples/nearest_entity.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'azalea/examples/nearest_entity.rs') diff --git a/azalea/examples/nearest_entity.rs b/azalea/examples/nearest_entity.rs index 8774829e..e859751e 100644 --- a/azalea/examples/nearest_entity.rs +++ b/azalea/examples/nearest_entity.rs @@ -2,7 +2,8 @@ use azalea::{Bot, ClientBuilder, LookAtEvent, nearest_entity::EntityFinder}; use azalea_client::Account; use azalea_core::tick::GameTick; use azalea_entity::{ - EyeHeight, LocalEntity, Position, + LocalEntity, Position, + dimensions::EntityDimensions, metadata::{ItemItem, Player}, }; use bevy_app::Plugin; @@ -33,7 +34,7 @@ impl Plugin for LookAtStuffPlugin { fn look_at_everything( bots: Query, With)>, entities: EntityFinder, - entity_positions: Query<(&Position, Option<&EyeHeight>)>, + entity_positions: Query<(&Position, Option<&EntityDimensions>)>, mut look_at_event: EventWriter, ) { for bot_id in bots.iter() { @@ -41,11 +42,11 @@ fn look_at_everything( continue; }; - let (position, eye_height) = entity_positions.get(entity).unwrap(); + let (position, dimensions) = entity_positions.get(entity).unwrap(); let mut look_target = **position; - if let Some(eye_height) = eye_height { - look_target.y += **eye_height as f64; + if let Some(dimensions) = dimensions { + look_target.y += dimensions.eye_height as f64; } look_at_event.write(LookAtEvent { -- cgit v1.2.3