[PR #6171] [MERGED] Let a creeper drop by its own health while it is chasing #6692

Closed
opened 2026-11-03 06:25:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6171
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/creeper-max-fall


📝 Commits (2)

  • 097b978 Let a creeper drop by its own health while it is chasing
  • 4d31db9 Skip the creeper fall test without the vanilla data

📊 Changes

1 file changed (+32 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/mobs/nav.rs (+32 -3)

📄 Description

Creeper.getMaxFallDistance throws Mob's shared formula away while it has a target:

// Creeper, verified with javap -p -c on client.jar 26.3
0: aload_0
1: invokevirtual  getTarget
4: ifnonnull      13
7: aload_0
8: fconst_0
9: invokevirtual  getComfortableFallDistance   // -> 3
13: aload_0
14: aload_0
15: invokevirtual getHealth
18: fconst_1
19: fsub
20: invokevirtual  getComfortableFallDistance   // -> floor(health - 1 + 3)

with LivingEntity.getComfortableFallDistance(float f) { return Mth.floor(f + 3.0F); }.

Horizon had only the shared Mob branch (health minus a third of max health, then 3), which
never returns more than 3 for a full-health creeper — so a creeper chasing a player would
refuse a drop that vanilla takes, at 22 blocks instead of 3.

Proven: on the build VM, cargo test -q -p horizon-client --lib mobs::nav::tests →
2 passed; 0 failed; 1235 filtered out, which includes the new
a_creeper_falls_by_its_own_health_while_it_has_a_target asserting 3 with no target,
22 at full health and 6 at four health.

Not proven: not checked in game. The in-game check: aggro a creeper across a ravine and
watch it walk off a drop deeper than three blocks.

One thing left deliberately: Mob.getMaxFallDistance also subtracts (3 - difficulty.getId()) * 4
from the sacrifice, and Horizon still hard-codes the normal-difficulty term here because the
method has no world to read the difficulty from. That is a separate change and is not touched.


🔄 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/6171 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/creeper-max-fall` --- ### 📝 Commits (2) - [`097b978`](https://github.com/horizon-rust/horizon/commit/097b9781adc7f67e6d230df8b38875b172bcb2e6) Let a creeper drop by its own health while it is chasing - [`4d31db9`](https://github.com/horizon-rust/horizon/commit/4d31db99b5a26fb5a290d341af6b560cc04898e4) Skip the creeper fall test without the vanilla data ### 📊 Changes **1 file changed** (+32 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/nav.rs` (+32 -3) </details> ### 📄 Description `Creeper.getMaxFallDistance` throws `Mob`'s shared formula away while it has a target: ```java // Creeper, verified with javap -p -c on client.jar 26.3 0: aload_0 1: invokevirtual getTarget 4: ifnonnull 13 7: aload_0 8: fconst_0 9: invokevirtual getComfortableFallDistance // -> 3 13: aload_0 14: aload_0 15: invokevirtual getHealth 18: fconst_1 19: fsub 20: invokevirtual getComfortableFallDistance // -> floor(health - 1 + 3) ``` with `LivingEntity.getComfortableFallDistance(float f) { return Mth.floor(f + 3.0F); }`. Horizon had only the shared `Mob` branch (health minus a third of max health, then 3), which never returns more than 3 for a full-health creeper — so a creeper chasing a player would refuse a drop that vanilla takes, at 22 blocks instead of 3. **Proven:** on the build VM, `cargo test -q -p horizon-client --lib mobs::nav::tests` → `2 passed; 0 failed; 1235 filtered out`, which includes the new `a_creeper_falls_by_its_own_health_while_it_has_a_target` asserting 3 with no target, 22 at full health and 6 at four health. **Not proven:** not checked in game. The in-game check: aggro a creeper across a ravine and watch it walk off a drop deeper than three blocks. One thing left deliberately: `Mob.getMaxFallDistance` also subtracts `(3 - difficulty.getId()) * 4` from the sacrifice, and Horizon still hard-codes the normal-difficulty term here because the method has no world to read the difficulty from. That is a separate change and is not touched. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:00 +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#6692
No description provided.