From e162f9cdb7d8756cdb2a4420e6e75c19968321ac Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Thu, 15 Oct 2026 11:47:02 +0200 Subject: [PATCH] Axes on copper: a shield in the off hand comes first, and sculk hears it Scraping and waxing off copper already swing the arm, show the scrape and wax-off particles and play the axe sound on main (#59, #104). Two gaps were left in BlockTransformer.transformBlock: - playerHasBlockingItemUseIntent: with a shield in the off hand, right-clicking with an axe raises the shield instead of scraping, unless sneaking. - The block_change game event, which sculk sensors pick up. Fixes #222 Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 32cf950ae..249a4950e 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -6543,6 +6543,16 @@ impl Game<'_> { else { return Ok(false); }; + // playerHasBlockingItemUseIntent: a shield in the off hand is raised + // instead, unless sneaking. + let shield = self + .offhand + .as_ref() + .and_then(|s| self.res.items.get(&s.item)) + .is_some_and(|i| i.blocks_attacks.is_some()); + if shield && !self.keys.contains(&KeyCode::ShiftLeft) { + return Ok(false); + } let face_name = match face { [0, -1, 0] => "down", [0, 1, 0] => "up", @@ -6601,6 +6611,7 @@ impl Game<'_> { 1.0, ); self.damage_held(damage); + self.post_block_game_event("minecraft:block_change", pos, self.sculk_actor(), Some(new)); Ok(true) } fn set_state_named(&mut self, pos: [i32; 3], name: &str, keep: &[&str]) -> Result {