[PR #2330] [MERGED] Let mobs trample farmland when they land on it #4212

Closed
opened 2026-11-03 04:15:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2330
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/mob-farmland-trample


📝 Commits (2)

  • c1844df Let mobs trample farmland when they land on it
  • 2277c85 Run neighbour updates when a mob trampling farmland places dirt

📊 Changes

2 files changed (+28 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+3 -3)
📝 crates/horizon-client/src/mobs/living.rs (+25 -0)

📄 Description

What and why

A cow dropped six blocks onto farmland left the farmland as it was. Only the player trampled farmland; a mob's landing only dealt fall damage.

When a mob lands with a fall distance above 0, the block it lands on is now checked. If it is farmland, the farmland turns to dirt when a random float is below fallDistance - 0.5, the mob_griefing rule is on, and width * width * height of the mob is over 0.512. The mob is lifted onto the dirt (the farmland is 1/16 lower than a full block). This is done in the mob's own landing code, before its fall damage, so it works the same on the server thread and in-frame.

Turtle eggs are not included: breaking them needs the egg count, a break sound and particles, which the mob event list has no way to carry, so it would not be a small change.

Vanilla reference

  • FarmlandBlock.fallOn / turnToBaseBlock (the trample condition: random float, living entity, mob griefing, volume over 0.512).
  • Entity.checkFallDamage calling Block.fallOn before causeFallDamage.
  • Block.pushEntitiesUp for the mob that lands.

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2330 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mob-farmland-trample` --- ### 📝 Commits (2) - [`c1844df`](https://github.com/horizon-rust/horizon/commit/c1844dfe57e5b3f02b90f9fabad813753aa7e7a4) Let mobs trample farmland when they land on it - [`2277c85`](https://github.com/horizon-rust/horizon/commit/2277c85fc3e486fa36ef6f4569a826a73db0cbd4) Run neighbour updates when a mob trampling farmland places dirt ### 📊 Changes **2 files changed** (+28 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -3) 📝 `crates/horizon-client/src/mobs/living.rs` (+25 -0) </details> ### 📄 Description ## What and why A cow dropped six blocks onto farmland left the farmland as it was. Only the player trampled farmland; a mob's landing only dealt fall damage. When a mob lands with a fall distance above 0, the block it lands on is now checked. If it is farmland, the farmland turns to dirt when a random float is below `fallDistance - 0.5`, the `mob_griefing` rule is on, and `width * width * height` of the mob is over 0.512. The mob is lifted onto the dirt (the farmland is 1/16 lower than a full block). This is done in the mob's own landing code, before its fall damage, so it works the same on the server thread and in-frame. Turtle eggs are not included: breaking them needs the egg count, a break sound and particles, which the mob event list has no way to carry, so it would not be a small change. ## Vanilla reference - `FarmlandBlock.fallOn` / `turnToBaseBlock` (the trample condition: random float, living entity, mob griefing, volume over 0.512). - `Entity.checkFallDamage` calling `Block.fallOn` before `causeFallDamage`. - `Block.pushEntitiesUp` for the mob that lands. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4212
No description provided.