From d7ec7b6077b73fa0159597d5f8ebdbf057701978 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 18:55:45 +0100 Subject: [PATCH] Shulker bullet split: record whether the shell was open at hit time --- crates/horizon-client/src/mobs/shulker.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/horizon-client/src/mobs/shulker.rs b/crates/horizon-client/src/mobs/shulker.rs index 124d1b299..6f0edc2d7 100644 --- a/crates/horizon-client/src/mobs/shulker.rs +++ b/crates/horizon-client/src/mobs/shulker.rs @@ -166,9 +166,10 @@ pub fn after_hurt(m: &mut Mob) { } /// `Shulker.hurtServer` after a shulker bullet's damage: unless the /// low-health teleport was drawn instead (`else if`), `hitByShulkerBullet` -/// runs on the next tick. +/// runs on the next tick. Whether the shell is open is read here, at hurt +/// time, so a goal opening it before that tick cannot change the outcome. pub fn hit_by_bullet(m: &mut Mob) { - if m.species() == Species::Shulker && !m.extra.flag { + if m.species() == Species::Shulker && !m.extra.flag && m.extra.counter != 0 { m.extra.flag2 = true; } } @@ -188,9 +189,10 @@ pub fn ai_step( hit_by_shulker_bullet(m, w, level_random, events); } } -/// `Shulker.hitByShulkerBullet`: an open shulker teleports, and leaves a -/// new one of its colour behind unless shulkers crowd the place (one in -/// five fewer chances for every other shulker within 8 blocks). +/// `Shulker.hitByShulkerBullet` (only queued by an open shulker): it +/// teleports, and leaves a new one of its colour behind unless shulkers +/// crowd the place (one in five fewer chances for every other shulker +/// within 8 blocks). fn hit_by_shulker_bullet( m: &mut Mob, w: &MobWorld, @@ -199,7 +201,7 @@ fn hit_by_shulker_bullet( ) { let old_position = m.position; let old_box = m.bounds(); - if m.extra.counter == 0 || !teleport(m, w, events) { + if !teleport(m, w, events) { return; } let area = old_box.inflate(Vec3::new(8.0, 8.0, 8.0));