[PR #3553] [MERGED] Projectiles hit a seated enderman #5044

Closed
opened 2026-11-03 05:09:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3553
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix-3381


📝 Commits (1)

  • a690cce Projectiles hit a seated enderman

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/enderman.rs (+32 -2)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

Fixes #3381

A seated enderman (in a boat, on a mob) dodged every projectile: arrows vanished with the teleport sound, snowballs and eggs bounced off without effect. mobs/enderman.rs on_damage rejected every projectile damage and queued repeatedlyTryToTeleport, whether the enderman rode something or not.

Vanilla only dodges when the enderman is not a passenger. This adds the !isPassenger() condition (m.extra.passenger), so a seated enderman takes the hit like any other mob, and a free one still teleports away.

Vanilla reference

net.minecraft.world.entity.monster.Enderman.hurtServer (26.3, javap):

40: aload_2
41: getstatic     DamageTypeTags.IS_PROJECTILE
44: invokevirtual DamageSource.is(TagKey)
47: ifeq          63
50: aload_0
51: invokevirtual isPassenger()
54: ifne          63          // a passenger falls through to Monster.hurtServer
57: aload_0
58: invokevirtual repeatedlyTryToTeleport()
61: iconst_0
62: ireturn

AbstractArrow.onHitEntity in 26.3 has no enderman special case left: a hit that hurtOrSimulate accepts is handled like any other mob.

Test

New unit test mobs::enderman::tests::projectiles_hit_a_seated_enderman (arrow, thrown and fireball damage; free vs seated).

cargo test -p horizon-client --lib mobs::enderman::tests

Before (the fix reverted, test kept):

thread 'mobs::enderman::tests::projectiles_hit_a_seated_enderman' panicked at crates\horizon-client\src\mobs\enderman.rs:462:13:
Arrow
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 641 filtered out

After:

test mobs::enderman::tests::projectiles_hit_a_seated_enderman ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 641 filtered out

Self-check

tools/pr_ready.py was not run (Windows). Commands run instead:

  • cargo fmt --all -- --check: clean
  • cargo clippy -p horizon-client --features mods --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib mobs::enderman::tests: 1 passed

No parity harness covers Enderman.hurtServer today.

In game

In game (single player on the server thread, fast build): /summon oak_boat ~ ~ ~ {Passengers:[{id:"minecraft:enderman"}]} at night, then an arrow summoned flying at it (/summon arrow ... {Motion:[0.0,0.0,1.5d]}).

  • Before: the arrow vanishes, the enderman keeps 40/40 health.
  • After: the arrow hits and sticks, the enderman drops to 37/40 and stays in the boat.

🤖 Generated with Claude Code


🔄 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/3553 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3381` --- ### 📝 Commits (1) - [`a690cce`](https://github.com/horizon-rust/horizon/commit/a690ccef3c87baa796e35a6ecb6d2d6ac0ba6b91) Projectiles hit a seated enderman ### 📊 Changes **1 file changed** (+32 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/enderman.rs` (+32 -2) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3381 A seated enderman (in a boat, on a mob) dodged every projectile: arrows vanished with the teleport sound, snowballs and eggs bounced off without effect. `mobs/enderman.rs` `on_damage` rejected every projectile damage and queued `repeatedlyTryToTeleport`, whether the enderman rode something or not. Vanilla only dodges when the enderman is not a passenger. This adds the `!isPassenger()` condition (`m.extra.passenger`), so a seated enderman takes the hit like any other mob, and a free one still teleports away. ## Vanilla reference `net.minecraft.world.entity.monster.Enderman.hurtServer` (26.3, javap): ``` 40: aload_2 41: getstatic DamageTypeTags.IS_PROJECTILE 44: invokevirtual DamageSource.is(TagKey) 47: ifeq 63 50: aload_0 51: invokevirtual isPassenger() 54: ifne 63 // a passenger falls through to Monster.hurtServer 57: aload_0 58: invokevirtual repeatedlyTryToTeleport() 61: iconst_0 62: ireturn ``` `AbstractArrow.onHitEntity` in 26.3 has no enderman special case left: a hit that `hurtOrSimulate` accepts is handled like any other mob. ## Test New unit test `mobs::enderman::tests::projectiles_hit_a_seated_enderman` (arrow, thrown and fireball damage; free vs seated). `cargo test -p horizon-client --lib mobs::enderman::tests` Before (the fix reverted, test kept): ``` thread 'mobs::enderman::tests::projectiles_hit_a_seated_enderman' panicked at crates\horizon-client\src\mobs\enderman.rs:462:13: Arrow test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 641 filtered out ``` After: ``` test mobs::enderman::tests::projectiles_hit_a_seated_enderman ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 641 filtered out ``` ## Self-check `tools/pr_ready.py` was not run (Windows). Commands run instead: - `cargo fmt --all -- --check`: clean - `cargo clippy -p horizon-client --features mods --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib mobs::enderman::tests`: 1 passed No parity harness covers `Enderman.hurtServer` today. ## In game In game (single player on the server thread, `fast` build): `/summon oak_boat ~ ~ ~ {Passengers:[{id:"minecraft:enderman"}]}` at night, then an arrow summoned flying at it (`/summon arrow ... {Motion:[0.0,0.0,1.5d]}`). - Before: the arrow vanishes, the enderman keeps 40/40 health. - After: the arrow hits and sticks, the enderman drops to 37/40 and stays in the boat. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:50 +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#5044
No description provided.