aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/testbot
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-03-28 03:47:48 +0700
committermat <git@matdoes.dev>2026-03-28 03:47:48 +0700
commitf09d07ce5cc6f8dfa336e214cda95b157bb80ae4 (patch)
treef1ed1ddaacef5d75eaef855494265915301c010a /azalea/examples/testbot
parent2d3e4194b885ec499826812da52c965f5a7235cf (diff)
downloadazalea-drasl-f09d07ce5cc6f8dfa336e214cda95b157bb80ae4.tar.xz
don't follow dead entities in testbot
Diffstat (limited to 'azalea/examples/testbot')
-rw-r--r--azalea/examples/testbot/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs
index 173f2b8c..034a80ad 100644
--- a/azalea/examples/testbot/main.rs
+++ b/azalea/examples/testbot/main.rs
@@ -186,7 +186,9 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> eyre::Result
killaura::tick(bot.clone(), state.clone())?;
if bot.ticks_connected().is_multiple_of(5) {
- if let Some(following) = &*state.following_entity.lock() {
+ if let Some(following) = &*state.following_entity.lock()
+ && following.is_alive()
+ {
let goal = RadiusGoal::new(following.position(), 3.);
if bot.is_calculating_path() {
// keep waiting