[PR #4503] [CLOSED] Make a spectral arrow glow the mob it hits #5661

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4503
Author: @MSedgeMC
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: fix/spectral-arrow-mob-glow


📝 Commits (1)

  • 5d3b452 Make a spectral arrow glow the mob it hits

📊 Changes

2 files changed (+9 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+7 -0)
📝 tools/port_map/classes-01.tsv (+2 -2)

📄 Description

Fixes the SpectralArrow.doPostHurtEffects row in the port ledger, which was half-ported. (No issue.)

SpectralArrow.doPostHurtEffects applies new MobEffectInstance(MobEffects.GLOWING, 200, 0) to whatever it hits, and Arrow.doPostHurtEffects does the same for a tipped arrow's potion effect. Horizon applied that effect only in the Who::Player arm of Game::projectile_hit; the Who::Mob(id) arm never read the effect it had already destructured, so a spectral arrow made another player glow and left a zombie untouched.

The mob arm now applies the same effect when the hit landed, exactly as the player arm does — same payload, same if hurt gate (a dodged enderman, an invulnerable target or a dead one gets nothing), same amplifier, applied immediately after the damage. As vanilla's two methods share the field, this also means a tipped arrow's effect reaches mobs.

What is proven: the change compiles on a build box (cargo check -p horizon-client → 0). The effect's own plumbing was already tested elsewhere: add_effect("glowing", 200, 0) → has_effect("minecraft:glowing") is asserted by an existing test, and glowing drives the outline (glowing.rs) and the synced shared-flags bit 0x40 (lan.rs → remote.rs).

What is not proven: no in-game check — the honest one is a summoned zombie shot with a spectral arrow, asserting its synced metadata carries the 0x40 bit for ~200 ticks and the outline is drawn, and that a dodged enderman does not glow. There is no unit-test shape for it: the handler is a method on the bin-only Game with no Game-free seam, and extracting one for a single caller would be a wrapper the repo's style rules out. pr_ready was not run, so CI's verify is the workspace check.

Two ledger rows corrected rather than left wrong: SpectralArrow.tick was already ported (game/remote_projectiles.rs, whose doc names it), and the old note claimed the release paths carry no effect when game.rs, crossbow.rs and dispenser.rs all set ("minecraft:glowing", 200).


🔄 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/4503 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/spectral-arrow-mob-glow` --- ### 📝 Commits (1) - [`5d3b452`](https://github.com/horizon-rust/horizon/commit/5d3b452e4ac1616ce48d3c3dec8b1527ab6e70fe) Make a spectral arrow glow the mob it hits ### 📊 Changes **2 files changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+7 -0) 📝 `tools/port_map/classes-01.tsv` (+2 -2) </details> ### 📄 Description Fixes the `SpectralArrow.doPostHurtEffects` row in the port ledger, which was half-ported. (No issue.) `SpectralArrow.doPostHurtEffects` applies `new MobEffectInstance(MobEffects.GLOWING, 200, 0)` to whatever it hits, and `Arrow.doPostHurtEffects` does the same for a tipped arrow's potion effect. Horizon applied that effect only in the `Who::Player` arm of `Game::projectile_hit`; the `Who::Mob(id)` arm never read the `effect` it had already destructured, so a spectral arrow made another player glow and left a zombie untouched. The mob arm now applies the same effect when the hit landed, exactly as the player arm does — same payload, same `if hurt` gate (a dodged enderman, an invulnerable target or a dead one gets nothing), same amplifier, applied immediately after the damage. As vanilla's two methods share the field, this also means a tipped arrow's effect reaches mobs. **What is proven:** the change compiles on a build box (`cargo check -p horizon-client` → 0). The effect's own plumbing was already tested elsewhere: `add_effect("glowing", 200, 0)` → `has_effect("minecraft:glowing")` is asserted by an existing test, and glowing drives the outline (`glowing.rs`) and the synced shared-flags bit 0x40 (`lan.rs` → `remote.rs`). **What is not proven:** no in-game check — the honest one is a summoned zombie shot with a spectral arrow, asserting its synced metadata carries the 0x40 bit for ~200 ticks and the outline is drawn, and that a dodged enderman does not glow. There is no unit-test shape for it: the handler is a method on the bin-only `Game` with no `Game`-free seam, and extracting one for a single caller would be a wrapper the repo's style rules out. `pr_ready` was not run, so CI's `verify` is the workspace check. Two ledger rows corrected rather than left wrong: `SpectralArrow.tick` was already ported (`game/remote_projectiles.rs`, whose doc names it), and the old note claimed the release paths carry no effect when `game.rs`, `crossbow.rs` and `dispenser.rs` all set `("minecraft:glowing", 200)`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:09 +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#5661
No description provided.