From 9958fe0e49b49e0a933c65d32309e1d362f18674 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 21:29:26 +0100 Subject: [PATCH] Light redstone ore when an entity stands on it --- crates/horizon-client/src/game/sculk.rs | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crates/horizon-client/src/game/sculk.rs b/crates/horizon-client/src/game/sculk.rs index 7916c46a1..9b066a710 100644 --- a/crates/horizon-client/src/game/sculk.rs +++ b/crates/horizon-client/src/game/sculk.rs @@ -1530,6 +1530,9 @@ impl Game<'_> { }); if let Some((at, on_ground, health, flying)) = player { let crouch = self.keys.contains(&KeyCode::ShiftLeft); + if on_ground && !self.spectator() { + self.step_on_redstone_ore(at, crouch); + } let in_water = self.in_water_at(at); self.entity_motion_events( Who::Player, @@ -1548,6 +1551,26 @@ impl Game<'_> { } } + /// `RedStoneOreBlock.stepOn`: standing on the ore lights it, unless the + /// entity is stepping carefully (`attack_block` only lights an unlit ore). + fn step_on_redstone_ore(&mut self, at: [f64; 3], carefully: bool) { + if carefully { + return; + } + // getOnPosLegacy: 0.2 below the feet. + let pos = [ + at[0].floor() as i32, + (at[1] - 0.2).floor() as i32, + at[2].floor() as i32, + ]; + if matches!( + &*self.block_name(pos), + "minecraft:redstone_ore" | "minecraft:deepslate_redstone_ore" + ) { + let _ = self.attack_block(pos); + } + } + fn tick_mob_sculk_events(&mut self) { let snapshot: Vec<(u32, [f64; 3], bool, bool, Species, Option)> = self .mobs @@ -1565,6 +1588,9 @@ impl Game<'_> { }) .collect(); for (id, at, on_ground, in_water, species, damaged) in snapshot { + if on_ground { + self.step_on_redstone_ore(at, false); + } let emits = !matches!(species, Species::Shulker); if emits { self.entity_motion_events(Who::Mob(id), at, on_ground, in_water, false, false);