[PR #2158] [MERGED] Fishing bobber hooks dropped items; owner luck and fish_caught match vanilla #4059

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

📋 Pull Request Information

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

Base: main ← Head: fix/fishing-hook-items


📝 Commits (1)

  • d68ab98 Let the fishing bobber hook dropped items, add owner luck, count only fish as fish caught

📊 Changes

1 file changed (+64 additions, -35 deletions)

View changed files

📝 crates/horizon-client/src/game/fishing.rs (+64 -35)

📄 Description

What and why

Three small fishing differences from vanilla:

  • The bobber could only hook living mobs. In vanilla it can also hook a dropped item lying in its path. Reeling in pulls the item toward the player and costs 3 durability (a hooked mob still costs 5).
  • Fishing loot luck used only the rod's Luck of the Sea level. Vanilla adds the player's own luck attribute (Luck and Bad Luck effects), so those effects now change the catch.
  • The fish_caught statistic went up by one for every catch, even when the catch was junk or treasure. It now goes up once per item that is in #minecraft:fishes (cod, salmon, pufferfish, tropical fish), as vanilla does.

The hooked item follows the same code as a hooked mob: the bobber rides along at 0.8 of the item's height, and goes back to flying if the item disappears (for example when someone picks it up).

Vanilla reference

  • FishingHook.canHitEntity: super.canHitEntity(entity) || entity.isAlive() && entity instanceof ItemEntity.
  • FishingHook.updateHookedEntity (setPos(hookedIn.getX(), hookedIn.getY(0.8), hookedIn.getZ())) and pullEntity.
  • FishingHook.retrieve: dmg = this.hookedIn instanceof ItemEntity ? 3 : 5, .withLuck(this.luck + owner.getLuck()), and if (itemStack.is(ItemTags.FISHES)) owner.awardStat(Stats.FISH_CAUGHT, 1) inside the loop over the caught items.
  • Player.getLuck reads Attributes.LUCK.

Self-check

cargo check -p horizon-client passes.


🔄 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/2158 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/fishing-hook-items` --- ### 📝 Commits (1) - [`d68ab98`](https://github.com/horizon-rust/horizon/commit/d68ab989c01e54033e498e8cde9cab84611749d9) Let the fishing bobber hook dropped items, add owner luck, count only fish as fish caught ### 📊 Changes **1 file changed** (+64 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/fishing.rs` (+64 -35) </details> ### 📄 Description ## What and why Three small fishing differences from vanilla: - The bobber could only hook living mobs. In vanilla it can also hook a dropped item lying in its path. Reeling in pulls the item toward the player and costs 3 durability (a hooked mob still costs 5). - Fishing loot luck used only the rod's Luck of the Sea level. Vanilla adds the player's own luck attribute (Luck and Bad Luck effects), so those effects now change the catch. - The `fish_caught` statistic went up by one for every catch, even when the catch was junk or treasure. It now goes up once per item that is in `#minecraft:fishes` (cod, salmon, pufferfish, tropical fish), as vanilla does. The hooked item follows the same code as a hooked mob: the bobber rides along at 0.8 of the item's height, and goes back to flying if the item disappears (for example when someone picks it up). ## Vanilla reference - `FishingHook.canHitEntity`: `super.canHitEntity(entity) || entity.isAlive() && entity instanceof ItemEntity`. - `FishingHook.updateHookedEntity` (`setPos(hookedIn.getX(), hookedIn.getY(0.8), hookedIn.getZ())`) and `pullEntity`. - `FishingHook.retrieve`: `dmg = this.hookedIn instanceof ItemEntity ? 3 : 5`, `.withLuck(this.luck + owner.getLuck())`, and `if (itemStack.is(ItemTags.FISHES)) owner.awardStat(Stats.FISH_CAUGHT, 1)` inside the loop over the caught items. - `Player.getLuck` reads `Attributes.LUCK`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:22 +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#4059
No description provided.