diff --git a/crates/horizon-client/src/mobs/ai.rs b/crates/horizon-client/src/mobs/ai.rs index 7ab91fd99..2af044209 100644 --- a/crates/horizon-client/src/mobs/ai.rs +++ b/crates/horizon-client/src/mobs/ai.rs @@ -1560,7 +1560,16 @@ pub fn after_hurt(m: &mut Mob, source: &Damage) { // PiglinAi.wasHurtBy: drop what is being admired, no admiring for // a while after a player's hit, and anger. Species::Piglin if source.attacker == Some(Who::Player) => { - m.extra.using_item = 0; + // stopHoldingOffHandItem(.., false): a gold ingot is not bartered + // and is gone; anything else ends its admiring next tick, as if + // the time ran out, and the game side puts it away. + if m.extra.off_hand.as_deref() == Some("minecraft:gold_ingot") { + m.extra.off_hand = None; + m.extra.using_item = 0; + } else { + m.extra.using_item = + i32::from(m.extra.off_hand.is_some() && m.extra.using_item > 0); + } m.extra.egg_time = 400; m.extra.anger = 600; }