[PR #6941] [MERGED] Bed explosions push the ender dragon #7215

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6941
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/6775-dragon-knockback


📝 Commits (2)

  • 1e66efc Bed and anchor blasts push the ender dragon
  • 94deb80 Dragon explosion push: vanilla's float eye height and normalize

📊 Changes

1 file changed (+55 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+55 -0)

📄 Description

🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself.

Fixes #6775

What: Bed (and respawn anchor) explosions now push the ender dragon, like vanilla. Before, Horizon applied the blast damage to the dragon but never its knockback.

Vanilla followed: ServerExplosion.hurtEntities applies entity.pushFromExplosion(direction * (1 - dist) * exposure * knockbackMultiplier * (1 - EXPLOSION_KNOCKBACK_RESISTANCE)) to every entity in range, with direction taken from the blast to the entity's eye. Entity.pushFromExplosion is push(impulse), which adds to the delta movement. EnderDragon does not override it, and EnderDragon.aiStep keeps the motion (adds, move, then scales by the slide factor). The dragon entity itself therefore gets pushed, while the parts do not, because they are only hurt. Horizon: Dragon::explosion_push, called from explosion_hits_special in dragon.rs.

Arrows: no change. In vanilla AbstractArrow only knocks back a LivingEntity, and the entity hit is an EnderDragonPart, so arrows never push the dragon. That part of the report is vanilla behaviour. The "pause mid air" expectation has no vanilla basis either: EnderDragon.hurt(part, ...) only calls onHurt and reallyHurt.

Evidence: unit test an_explosion_pushes_the_dragon_along_the_blast (passes; cargo test --profile fast -p horizon-client --lib dragon: 18 passed). Before the change nothing added to velocity on an explosion. I did not run the game or a harness for this (no dragon explosion harness exists in tools/, and a full parity run was not possible on the shared runner).

pr_ready --quick: not clean. horizon-client-lib fails to compile in crates/horizon-client/src/lan/hub/chat_filter.rs (errors on muted_notice, Guard::mutes and similar), which this PR does not touch, so clippy and the client tests could not finish. The dragon unit tests were run directly before the rebase and passed. Left to CI: full build, clippy, parity.


🔄 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/6941 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6775-dragon-knockback` --- ### 📝 Commits (2) - [`1e66efc`](https://github.com/horizon-rust/horizon/commit/1e66efcf06f64e58d34a15949d71afa8b0a868ad) Bed and anchor blasts push the ender dragon - [`94deb80`](https://github.com/horizon-rust/horizon/commit/94deb80b8984d771a59ba0840afc69d62701770e) Dragon explosion push: vanilla's float eye height and normalize ### 📊 Changes **1 file changed** (+55 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+55 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #6775 **What:** Bed (and respawn anchor) explosions now push the ender dragon, like vanilla. Before, Horizon applied the blast damage to the dragon but never its knockback. **Vanilla followed:** `ServerExplosion.hurtEntities` applies `entity.pushFromExplosion(direction * (1 - dist) * exposure * knockbackMultiplier * (1 - EXPLOSION_KNOCKBACK_RESISTANCE))` to every entity in range, with `direction` taken from the blast to the entity's eye. `Entity.pushFromExplosion` is `push(impulse)`, which adds to the delta movement. `EnderDragon` does not override it, and `EnderDragon.aiStep` keeps the motion (adds, `move`, then scales by the slide factor). The dragon entity itself therefore gets pushed, while the parts do not, because they are only hurt. Horizon: `Dragon::explosion_push`, called from `explosion_hits_special` in `dragon.rs`. **Arrows:** no change. In vanilla `AbstractArrow` only knocks back a `LivingEntity`, and the entity hit is an `EnderDragonPart`, so arrows never push the dragon. That part of the report is vanilla behaviour. The "pause mid air" expectation has no vanilla basis either: `EnderDragon.hurt(part, ...)` only calls `onHurt` and `reallyHurt`. **Evidence:** unit test `an_explosion_pushes_the_dragon_along_the_blast` (passes; `cargo test --profile fast -p horizon-client --lib dragon`: 18 passed). Before the change nothing added to `velocity` on an explosion. I did not run the game or a harness for this (no dragon explosion harness exists in tools/, and a full parity run was not possible on the shared runner). **pr_ready --quick:** not clean. `horizon-client-lib` fails to compile in `crates/horizon-client/src/lan/hub/chat_filter.rs` (errors on `muted_notice`, `Guard::mutes` and similar), which this PR does not touch, so clippy and the client tests could not finish. The dragon unit tests were run directly before the rebase and passed. Left to CI: full build, clippy, parity. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35: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#7215
No description provided.