[GH-ISSUE #7440] Fishing bobber launches high into the sky when casting straight down #3241

Open
opened 2026-11-03 04:06:56 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @byMehd on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7440

Originally assigned to: @StarWeizz on GitHub.

When looking straight down at the ground (with the camera aimed as far down as possible) and casting a fishing rod, the fishing bobber launches very high into the sky in Horizon.

In vanilla Minecraft Java Edition, the bobber simply lands on the ground in front of the player.

Steps to reproduce:

  1. Stand on flat ground with a fishing rod.
  2. Aim the camera straight down, as far as possible.
  3. Right-click to cast the fishing rod.
  4. Observe the bobber flying high into the sky instead of landing on the ground.

See attached video showing the issue.

Possibly related issue:
https://github.com/horizon-rust/horizon/issues/7436

This issue describes a different problem where the fishing bobber moves slightly towards the player after landing on the ground. Although the two behaviors are not identical, they might be related to the same underlying fishing bobber physics or movement handling.

Tested on:

  • OS: Windows PC
  • Horizon version: Nightly c9d474d

video :
https://github.com/user-attachments/assets/60dcb0e2-8009-4124-9c9e-69e3efc19bf9

Originally created by @byMehd on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7440 Originally assigned to: @StarWeizz on GitHub. When looking straight down at the ground (with the camera aimed as far down as possible) and casting a fishing rod, the fishing bobber launches very high into the sky in Horizon. In vanilla Minecraft Java Edition, the bobber simply lands on the ground in front of the player. **Steps to reproduce:** 1. Stand on flat ground with a fishing rod. 2. Aim the camera straight down, as far as possible. 3. Right-click to cast the fishing rod. 4. Observe the bobber flying high into the sky instead of landing on the ground. See attached video showing the issue. **Possibly related issue:** https://github.com/horizon-rust/horizon/issues/7436 This issue describes a different problem where the fishing bobber moves slightly towards the player after landing on the ground. Although the two behaviors are not identical, they might be related to the same underlying fishing bobber physics or movement handling. Tested on: - OS: Windows PC - Horizon version: Nightly `c9d474d` video : https://github.com/user-attachments/assets/60dcb0e2-8009-4124-9c9e-69e3efc19bf9
Author
Owner

@Joansitoh commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally.

Cause: Game::use_fishing_rod in crates/horizon-client/src/game/fishing.rs (~L203-208) computes the cast direction with libm cos/sin. Vanilla FishingHook(Player, Level, int, int) uses Mth.cos/Mth.sin (the 65536-entry table). At pitch 90, libm gives cos(-pi/2 as f32) = -4.37e-8, so xCos = +4.37e-8 and -(xSin/xCos) clamps to +5 (the bobber goes up). Vanilla's table gives xCos = -0.0, so the value is -inf and clamps to -5 (down). Pitch -90 is inverted as well, and other angles differ in the last bits.

Plan: extract a pure cast_direction(yaw, pitch) that uses horizon_core::geometry::trig::{sin, cos} with f32 angle math like Java (-yaw * DEG_TO_RAD - PI). Leave the speed multiply and the random draws as they are. Add unit tests (pitch 90 → y = -5, pitch -90 → y = +5, other angles with independently computed table values) and check fishing-hook-entities-parity.

<!-- gh-comment-id:6583363995 --> @Joansitoh commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. Cause: `Game::use_fishing_rod` in `crates/horizon-client/src/game/fishing.rs` (~L203-208) computes the cast direction with libm `cos`/`sin`. Vanilla `FishingHook(Player, Level, int, int)` uses `Mth.cos`/`Mth.sin` (the 65536-entry table). At pitch 90, libm gives `cos(-pi/2 as f32) = -4.37e-8`, so `xCos = +4.37e-8` and `-(xSin/xCos)` clamps to +5 (the bobber goes up). Vanilla's table gives `xCos = -0.0`, so the value is -inf and clamps to -5 (down). Pitch -90 is inverted as well, and other angles differ in the last bits. Plan: extract a pure `cast_direction(yaw, pitch)` that uses `horizon_core::geometry::trig::{sin, cos}` with f32 angle math like Java (`-yaw * DEG_TO_RAD - PI`). Leave the speed multiply and the random draws as they are. Add unit tests (pitch 90 → y = -5, pitch -90 → y = +5, other angles with independently computed table values) and check `fishing-hook-entities-parity`.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, You hold 8 open issues: finish or /unclaim one first. (asked by @Joansitoh)

<!-- gh-comment-id:6583380358 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, You hold 8 open issues: finish or `/unclaim` one first. (asked by @Joansitoh)
Author
Owner

@StarWeizz commented on GitHub (Nov 2, 2026):

/claim

<!-- gh-comment-id:6583435415 --> @StarWeizz commented on GitHub (Nov 2, 2026): /claim
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#3241
No description provided.