[PR #6172] [MERGED] Read the difficulty for a drowned's trident spread #6695

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

📋 Pull Request Information

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

Base: main ← Head: fix/drowned-uncertainty


📝 Commits (1)

  • 3217c67 Read the difficulty for a drowned's trident spread

📊 Changes

1 file changed (+24 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mobs/undead.rs (+24 -1)

📄 Description

Drowned.performRangedAttack does not pick its own spread; it asks
RangedAttackMob.rangedAttackUncertainty(Level):

// net/minecraft/world/entity/monster/RangedAttackMob, javap -p -c
0: bipush        14
2: aload_1          // level
3: invokevirtual  Level.getDifficulty
6: invokevirtual  Difficulty.getId
9: iconst_4
10: imul
11: isub
12: i2f
13: freturn

so the uncertainty is 14 / 10 / 6 / 2 on peaceful / easy / normal / hard. Horizon passed a
literal (14 - 2 * 4), i.e. the normal-difficulty value on every difficulty — a peaceful
or easy drowned threw as straight as a hard one.

Proven: on the build VM, cargo test -q -p horizon-client --lib mobs::undead →
3 passed; 0 failed; 1234 filtered out, including the new
the_trident_spread_follows_the_difficulty asserting 14 / 10 / 6 / 2.

Not proven: not checked in game; the observable is a drowned missing more often on easy.
The test pins the formula, not the projectile (the spread is consumed into the velocity by
Projectile.shoot and is not stored).

One deliberate omission: vanilla's Drowned also has a rangedAttackUncertainty field that
overrides the interface default when non-negative. Nothing in the game sets it (only
setRangedAttackUncertainty, which has no callers), so it is not modelled.


🔄 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/6172 **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/drowned-uncertainty` --- ### 📝 Commits (1) - [`3217c67`](https://github.com/horizon-rust/horizon/commit/3217c6759bbc80695b83f8a0a8eb8caaf2002ce3) Read the difficulty for a drowned's trident spread ### 📊 Changes **1 file changed** (+24 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/undead.rs` (+24 -1) </details> ### 📄 Description `Drowned.performRangedAttack` does not pick its own spread; it asks `RangedAttackMob.rangedAttackUncertainty(Level)`: ```java // net/minecraft/world/entity/monster/RangedAttackMob, javap -p -c 0: bipush 14 2: aload_1 // level 3: invokevirtual Level.getDifficulty 6: invokevirtual Difficulty.getId 9: iconst_4 10: imul 11: isub 12: i2f 13: freturn ``` so the uncertainty is 14 / 10 / 6 / 2 on peaceful / easy / normal / hard. Horizon passed a literal `(14 - 2 * 4)`, i.e. the normal-difficulty value on every difficulty — a peaceful or easy drowned threw as straight as a hard one. **Proven:** on the build VM, `cargo test -q -p horizon-client --lib mobs::undead` → `3 passed; 0 failed; 1234 filtered out`, including the new `the_trident_spread_follows_the_difficulty` asserting 14 / 10 / 6 / 2. **Not proven:** not checked in game; the observable is a drowned missing more often on easy. The test pins the formula, not the projectile (the spread is consumed into the velocity by `Projectile.shoot` and is not stored). One deliberate omission: vanilla's `Drowned` also has a `rangedAttackUncertainty` field that overrides the interface default when non-negative. Nothing in the game sets it (only `setRangedAttackUncertainty`, which has no callers), so it is not modelled. --- <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:01 +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#6695
No description provided.