[PR #1155] [MERGED] Riptide: the auto-spin attack (pose, contact hit, spinning model, effect layer, first-person pose) #3101

Closed
opened 2026-11-02 16:01:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/riptide-spin-attack


📝 Commits (1)

  • 8e700aa Riptide: run vanilla's auto-spin attack after the launch

📊 Changes

9 files changed (+210 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/first_person.rs (+8 -0)
📝 crates/horizon-client/src/game.rs (+30 -3)
📝 crates/horizon-client/src/game/lan.rs (+3 -1)
📝 crates/horizon-client/src/game/perspective.rs (+44 -0)
📝 crates/horizon-client/src/game/trident.rs (+35 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/render.rs (+8 -1)
📝 crates/horizon-client/src/motion.rs (+74 -0)
📝 crates/horizon-client/src/pose.rs (+6 -2)

📄 Description

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

Fixes #536. Reported on Discord by patrick (#horizon-bugs): after a Riptide throw "the player does not spin and the spinning texture is missing; in first person … the trident item position does not change". The third-person throw pose was already fixed in #691; this PR adds the spin itself.

What

Releasing a Riptide trident now runs vanilla's LivingEntity.startAutoSpinAttack(20, 8.0F, stack) (TridentItem.releaseUsing), not only the launch velocity.

Movement (motion.rs)

  • Each tick, aiStep keeps the box from before travel. While the spin lasts, it counts down and calls checkAutoSpinAttack.
  • The first living entity inside the swept box (old box ∪ new box) is hit. The spin then ends and the velocity is scaled by −0.2 (the bounce back).
  • Otherwise a horizontal collision ends the spin.

Pose (pose.rs)

  • Pose.SPIN_ATTACK: 0.6×0.6 with eye height 0.4, chosen after fall flying while the spin lasts.

Combat (game.rs, game/trident.rs)

  • Player.attack uses autoSpinAttackDmg (8) as the base damage of the contact hit.
  • The mob half of attack() moved into attack_mob so the spin can use it.
  • The arm swing now comes after the attack, as in Minecraft.startAttack.

Rendering (mobs/render.rs, game/perspective.rs, first_person.rs)

  • LivingEntityRenderer.setupRotations: rotX(−90 − xRot), rotY(age · −75). As in AvatarRenderer, the fall-flying tilt is skipped while spinning.
  • SpinAttackEffectLayer: the minecraft:spin_attack#main model with entity/trident/trident_riptide; box i turns by wrapDegrees(age · −(45 + (i+1)·5)).
  • First person, ItemInHandRenderer's spin branch: translate(invert·−0.4, 0.8, 0.3), rotY(invert·65), rotZ(invert·−85). The trident is held up "like a fork", as the report describes.

LAN (game/lan.rs)

  • The host sends living flag bit 4 while spinning, so guests see the host spin.

Armour-stand rendering is not touched (ItsPotatoTime is working on holograms).

Screenshots

Taken offscreen with horizon-ctl on the Mac mini, the same scene on main (left) and this branch (right): a Riptide III trident released in a water cube, 1 tick after release.

Third person: on main the player rises upright. On the branch the player lies flat, spinning, inside the riptide boxes.
third person

First person: on main the trident stays in the normal held pose. On the branch it moves up into the spin pose.
first person

Single frames: main third person, branch third person, branch, a second frame, main first person, branch first person.

No vanilla client capture: the Mac mini's screen is locked, so driving a vanilla client through a riptide throw wasn't possible from this session. The transforms are copied term by term from the classes named above.

How tested

  • New test a_riptide_spin_lies_flat_and_ends_on_the_first_entity_it_touches (motion.rs) checks:
    • the spin pose and box;
    • the countdown;
    • the first contact ending the spin with the −0.2 bounce.
cargo fmt --all -- --check                                   OK
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings
                                                             Finished, no warnings
cargo test -p horizon-client                                 969 + 84 + 15 + 2 + 2 + 2 + 1 passed, 0 failed
tools/parity.py --changed origin/main (branch)               101 passed, 0 failed in 49.4 min

No harness failed on the branch, so none needed a comparison run on main.

Known limits (in FEATURES.md LATER 4m)

  • A LAN guest's own spin isn't sent to others, and guests deal no spin contact hits (the host's spin works).
  • The inventory player preview draws no spin layer.
  • Riptide's ground hop is still the existing +1.2 teleport.

What needs Ludovic

  • A look in game: throw a Riptide trident in rain or water, and hit a mob mid-spin.

🤖 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/1155 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/riptide-spin-attack` --- ### 📝 Commits (1) - [`8e700aa`](https://github.com/horizon-rust/horizon/commit/8e700aa68362a9d9b0c377c84fbb760055a4e8e9) Riptide: run vanilla's auto-spin attack after the launch ### 📊 Changes **9 files changed** (+210 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/first_person.rs` (+8 -0) 📝 `crates/horizon-client/src/game.rs` (+30 -3) 📝 `crates/horizon-client/src/game/lan.rs` (+3 -1) 📝 `crates/horizon-client/src/game/perspective.rs` (+44 -0) 📝 `crates/horizon-client/src/game/trident.rs` (+35 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+8 -1) 📝 `crates/horizon-client/src/motion.rs` (+74 -0) 📝 `crates/horizon-client/src/pose.rs` (+6 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #536. Reported on Discord by **patrick** (#horizon-bugs): after a Riptide throw "the player does not spin and the spinning texture is missing; in first person … the trident item position does not change". The third-person throw pose was already fixed in #691; this PR adds the spin itself. ## What Releasing a Riptide trident now runs vanilla's `LivingEntity.startAutoSpinAttack(20, 8.0F, stack)` (`TridentItem.releaseUsing`), not only the launch velocity. **Movement** (`motion.rs`) - Each tick, `aiStep` keeps the box from before `travel`. While the spin lasts, it counts down and calls `checkAutoSpinAttack`. - The first living entity inside the swept box (old box ∪ new box) is hit. The spin then ends and the velocity is scaled by −0.2 (the bounce back). - Otherwise a horizontal collision ends the spin. **Pose** (`pose.rs`) - `Pose.SPIN_ATTACK`: 0.6×0.6 with eye height 0.4, chosen after fall flying while the spin lasts. **Combat** (`game.rs`, `game/trident.rs`) - `Player.attack` uses `autoSpinAttackDmg` (8) as the base damage of the contact hit. - The mob half of `attack()` moved into `attack_mob` so the spin can use it. - The arm swing now comes after the attack, as in `Minecraft.startAttack`. **Rendering** (`mobs/render.rs`, `game/perspective.rs`, `first_person.rs`) - `LivingEntityRenderer.setupRotations`: rotX(−90 − xRot), rotY(age · −75). As in `AvatarRenderer`, the fall-flying tilt is skipped while spinning. - `SpinAttackEffectLayer`: the `minecraft:spin_attack#main` model with `entity/trident/trident_riptide`; box *i* turns by wrapDegrees(age · −(45 + (i+1)·5)). - First person, `ItemInHandRenderer`'s spin branch: translate(invert·−0.4, 0.8, 0.3), rotY(invert·65), rotZ(invert·−85). The trident is held up "like a fork", as the report describes. **LAN** (`game/lan.rs`) - The host sends living flag bit 4 while spinning, so guests see the host spin. Armour-stand rendering is not touched (ItsPotatoTime is working on holograms). ## Screenshots Taken offscreen with `horizon-ctl` on the Mac mini, the same scene on `main` (left) and this branch (right): a Riptide III trident released in a water cube, 1 tick after release. Third person: on `main` the player rises upright. On the branch the player lies flat, spinning, inside the riptide boxes. ![third person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/cmp-spin-a.png) First person: on `main` the trident stays in the normal held pose. On the branch it moves up into the spin pose. ![first person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/cmp-fp-spin.png) Single frames: [main third person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/main-spin-a.png), [branch third person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/pr-spin-a.png), [branch, a second frame](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/pr-spin-b.png), [main first person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/main-fp-spin.png), [branch first person](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/q2-parity-entities-audio/riptide/pr-fp-spin.png). No vanilla client capture: the Mac mini's screen is locked, so driving a vanilla client through a riptide throw wasn't possible from this session. The transforms are copied term by term from the classes named above. ## How tested - New test `a_riptide_spin_lies_flat_and_ends_on_the_first_entity_it_touches` (`motion.rs`) checks: - the spin pose and box; - the countdown; - the first contact ending the spin with the −0.2 bounce. ``` cargo fmt --all -- --check OK set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings Finished, no warnings cargo test -p horizon-client 969 + 84 + 15 + 2 + 2 + 2 + 1 passed, 0 failed tools/parity.py --changed origin/main (branch) 101 passed, 0 failed in 49.4 min ``` No harness failed on the branch, so none needed a comparison run on `main`. ## Known limits (in FEATURES.md LATER 4m) - A LAN guest's own spin isn't sent to others, and guests deal no spin contact hits (the host's spin works). - The inventory player preview draws no spin layer. - Riptide's ground hop is still the existing +1.2 teleport. ## What needs Ludovic - A look in game: throw a Riptide trident in rain or water, and hit a mob mid-spin. 🤖 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-02 16:01:31 +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#3101
No description provided.