From 50fdcad10fed4dc812228d0cd24390d3ed326002 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 19:40:42 +0100 Subject: [PATCH 1/2] A cookie poisons and kills a parrot --- crates/horizon-client/src/game/creatures.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 845d2aee6..45568dc12 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -2560,6 +2560,7 @@ impl Game<'_> { .items() .get(&item) .is_some_and(|i| i.max_damage > 0); + let player_at = self.eye_position(); let m = &mut self.mobs[index]; if !m.alive() { return Ok(false); @@ -2816,6 +2817,24 @@ impl Game<'_> { consume = true; } } + // Parrot.mobInteract: #parrot_poisonous_food (a cookie) poisons the + // parrot for 45 s and then hurts it with a player attack of + // Float.MAX_VALUE, which an invulnerable one shrugs off. + Species::Parrot + if self + .res + .items() + .item_tags + .get("minecraft:parrot_poisonous_food") + .is_some_and(|t| t.contains(&*item)) => + { + consume = true; + m.add_effect("minecraft:poison", 900, 0); + m.damage( + f32::MAX, + horizon_client::mobs::Damage::player(player_at.unwrap_or(center)), + ); + } // Parrot.mobInteract: parrot food may tame a wild one (one time in // ten); a parrot never takes it as Animal food (isFood is false). Species::Parrot if !m.extra.tame && is_food => { From 2a297a43eb65807666978fd75128bb779e61b8f5 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 21:42:51 +0100 Subject: [PATCH 2/2] Credit the feeder with a parrot's cookie kill --- crates/horizon-client/src/game/creatures.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 45568dc12..069768cb8 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -2830,10 +2830,15 @@ impl Game<'_> { { consume = true; m.add_effect("minecraft:poison", 900, 0); - m.damage( + let id = m.id; + let hurt = m.damage( f32::MAX, horizon_client::mobs::Damage::player(player_at.unwrap_or(center)), ); + // The feeder gets the kill, as for a normal player attack. + if hurt { + self.last_hurt_by_player.insert(id, self.lan_acting); + } } // Parrot.mobInteract: parrot food may tame a wild one (one time in // ten); a parrot never takes it as Animal food (isFood is false).