[PR #5377] [MERGED] A player's blow pops a shulker bullet #6247

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5377
Author: @xFedeT
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/shulker-bullet-hurt


📝 Commits (1)

  • f286230 A blow from a player pops a shulker bullet

📊 Changes

2 files changed (+80 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/game/deflect.rs (+71 -9)
📝 crates/horizon-client/src/game/lan_actions.rs (+9 -2)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Part of #3514: the ShulkerBullet.hurtServer row (the last comment on the issue says it waits for the hurt path and the sound; both are in ShulkerBullet.java).

Vanilla

public boolean hurtServer(final ServerLevel level, final DamageSource source, final float damage) {
   this.playSound(SoundEvents.SHULKER_BULLET_HURT, 1.0F, 1.0F);
   level.sendParticles(ParticleTypes.CRIT, this.getX(), this.getY(), this.getZ(), 15, 0.2, 0.2, 0.2, 0.0);
   this.destroy();
   return true;
}

isPickable() is true, so a player's crosshair finds the bullet and Player.attack hurts it. Unlike AbstractHurtingProjectile (fireballs and wind charges, pick radius 1) its pick radius is 0.

What changes

  • A shulker bullet is attackable with the redirectable projectiles (deflect.rs::attackable), with its own box and no pick radius (pick_radius; within_interaction_range uses it too, or the guest's range check shrank the 0.3 box inside out).
  • Game::hit_shulker_bullet: the entity.shulker_bullet.hurt sound, fifteen crit particles (spread 0.2, sent to the players) and the bullet gone. The blow itself is Player.attack on a target that is not a mob: its sounds and sweep (vehicle_attack_sounds), the swing and the attack-strength reset.
  • The same on a server: a guest's attack packet reaches it through guest_attack (lan_actions.rs), checked against isWithinEntityInteractionRange.

What it depends on

Another projectile hitting a bullet (an arrow, a snowball) is Projectile.onHitEntity on a projectile target; Horizon's only projectile-versus-projectile hit is a thrown pearl against a wind charge (wind_charge_hitboxes), so those need that system first and are not covered here.

Verification

  • deflect::tests::only_ghast_fireballs_and_wind_charges_are_redirectable has the bullet's attackable, redirectable and box (no pick radius).
  • Real run on the server thread (survival, a shulker shooting at the player, tick freeze to hold a bullet in front of the crosshair, one click): the game heard entity.shulker_bullet.hurt and the bullet was gone (server log: guest_attack id=1203).
before the click after
bullet in the crosshair bullet gone
  • pr_ready --quick: rustfmt and clippy pass. The only failures are the 8 lan_bot tests and one test_perf_bench Python test, which fail the same way on a clean origin/main here.

🤖 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/5377 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/shulker-bullet-hurt` --- ### 📝 Commits (1) - [`f286230`](https://github.com/horizon-rust/horizon/commit/f286230b3eb3e9e8bf8791ad633525e1575fd803) A blow from a player pops a shulker bullet ### 📊 Changes **2 files changed** (+80 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/deflect.rs` (+71 -9) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+9 -2) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Part of #3514: the `ShulkerBullet.hurtServer` row (the last comment on the issue says it waits for the hurt path and the sound; both are in `ShulkerBullet.java`). ## Vanilla ```java public boolean hurtServer(final ServerLevel level, final DamageSource source, final float damage) { this.playSound(SoundEvents.SHULKER_BULLET_HURT, 1.0F, 1.0F); level.sendParticles(ParticleTypes.CRIT, this.getX(), this.getY(), this.getZ(), 15, 0.2, 0.2, 0.2, 0.0); this.destroy(); return true; } ``` `isPickable()` is `true`, so a player's crosshair finds the bullet and `Player.attack` hurts it. Unlike `AbstractHurtingProjectile` (fireballs and wind charges, pick radius 1) its pick radius is 0. ## What changes - A shulker bullet is attackable with the redirectable projectiles (`deflect.rs::attackable`), with its own box and no pick radius (`pick_radius`; `within_interaction_range` uses it too, or the guest's range check shrank the 0.3 box inside out). - `Game::hit_shulker_bullet`: the `entity.shulker_bullet.hurt` sound, fifteen `crit` particles (spread 0.2, sent to the players) and the bullet gone. The blow itself is `Player.attack` on a target that is not a mob: its sounds and sweep (`vehicle_attack_sounds`), the swing and the attack-strength reset. - The same on a server: a guest's attack packet reaches it through `guest_attack` (`lan_actions.rs`), checked against `isWithinEntityInteractionRange`. ## What it depends on Another projectile hitting a bullet (an arrow, a snowball) is `Projectile.onHitEntity` on a projectile target; Horizon's only projectile-versus-projectile hit is a thrown pearl against a wind charge (`wind_charge_hitboxes`), so those need that system first and are not covered here. ## Verification - `deflect::tests::only_ghast_fireballs_and_wind_charges_are_redirectable` has the bullet's `attackable`, `redirectable` and box (no pick radius). - Real run on the server thread (survival, a shulker shooting at the player, `tick freeze` to hold a bullet in front of the crosshair, one click): the game heard `entity.shulker_bullet.hurt` and the bullet was gone (server log: `guest_attack id=1203`). | before the click | after | | --- | --- | | ![bullet in the crosshair](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/3514/shulker-bullet-before.png) | ![bullet gone](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/3514/shulker-bullet-after.png) | - `pr_ready --quick`: rustfmt and clippy pass. The only failures are the 8 `lan_bot` tests and one `test_perf_bench` Python test, which fail the same way on a clean `origin/main` here. 🤖 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 06:16:19 +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#6247
No description provided.