From c1844dfe57e5b3f02b90f9fabad813753aa7e7a4 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 18:46:37 +0100 Subject: [PATCH 1/2] Let mobs trample farmland when they land on it A cow dropped onto farmland left it untouched. A landing mob now turns farmland to dirt with chance fall distance - 0.5, when mob griefing is on and the mob is big enough, and is lifted onto the dirt. --- crates/horizon-client/src/mobs/living.rs | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/horizon-client/src/mobs/living.rs b/crates/horizon-client/src/mobs/living.rs index 394821ace..afd0c26db 100644 --- a/crates/horizon-client/src/mobs/living.rs +++ b/crates/horizon-client/src/mobs/living.rs @@ -440,11 +440,36 @@ impl Mob { } if self.on_ground { if self.fall_distance > 0.0 { + self.trample_farmland(w, events); self.cause_fall_damage(events); } self.fall_distance = 0.0; } } + /// `FarmlandBlock.fallOn`: a landing on farmland turns it to dirt with + /// chance `fallDistance - 0.5`, if mobs may grief and the mob's + /// `width * width * height` is over 0.512. `Block.pushEntitiesUp` lifts + /// the mob onto the dirt, which is a full block. + fn trample_farmland(&mut self, w: &MobWorld, events: &mut Vec) { + let p = self.block_on_legacy(w); + if w.block_name(p[0], p[1], p[2]) != "minecraft:farmland" { + return; + } + let roll = f64::from(self.random.next_float()); + let Some(dirt) = w.registry.default_state("minecraft:dirt") else { + return; + }; + if roll < self.fall_distance - 0.5 + && w.mob_griefing + && self.width() * self.width() * self.height() > 0.512 + { + events.push(MobEvent::SetBlock { + pos: p, + state: dirt, + }); + self.position.y = self.position.y.max(f64::from(p[1]) + 1.0); + } + } /// Entity.updateFluidInteraction: the fluid state, then touching water /// resets the fall and entering it (after the first tick) splashes. pub(super) fn update_fluids(&mut self, w: &MobWorld, events: &mut Vec) { From 2277c85fc3e486fa36ef6f4569a826a73db0cbd4 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 19:07:02 +0100 Subject: [PATCH 2/2] Run neighbour updates when a mob trampling farmland places dirt --- crates/horizon-client/src/game/creatures.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 2b65a3289..f08f41d01 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -1037,9 +1037,9 @@ impl Game<'_> { [0.0, 0.2, 0.0], 10, ), - MobEvent::SetBlock { pos, state } => { - self.world.set(pos[0], pos[1], pos[2], state)? - } + // `Level.setBlockAndUpdate`: neighbour and shape updates, so a crop + // above trampled farmland breaks and drops. + MobEvent::SetBlock { pos, state } => self.level_set(pos, state)?, MobEvent::SetDoorOpen { pos, open } => { let pos = BlockPos::new(pos[0], pos[1], pos[2]); self.with_level(|b, level, ticks| b.set_door_open(level, ticks, pos, open));