[PR #2152] [MERGED] Apply Unbreaking to thrown tridents and stop Riptide while riding #4053

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

📋 Pull Request Information

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

Base: main ← Head: fix/trident-unbreaking-riptide


📝 Commits (1)

  • 4d01167 Apply Unbreaking to thrown tridents and stop Riptide while riding

📊 Changes

2 files changed (+23 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+18 -0)
📝 crates/horizon-client/src/game/trident.rs (+5 -8)

📄 Description

What and why

Two small trident bugs:

  • Throwing a trident added exactly 1 damage and ignored Unbreaking. It now goes through the same durability calculation as every other item, and it still stops at 1 durability left instead of breaking (the throw is refused earlier when the next point of damage would break it).
  • Riptide launched a player who was riding a boat, minecart or mount. It now needs the player to be in water or rain and not riding.

The wear for both throwing and Riptide uses one new helper, hurt_held_without_breaking, next to damage_held in game.rs. It does nothing in creative mode.

Vanilla reference

  • TridentItem.releaseUsing: itemStack.hurtWithoutBreaking(1, player) for both the throw and Riptide, and the Riptide condition isInWaterOrRain() && !isPassenger().
  • ItemStack.hurtWithoutBreaking and processDurabilityChange: Unbreaking applies, nothing happens for infinite materials, and the damage is capped at getMaxDamage() - 1.
  • Entity.isPassenger.

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/2152 **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/trident-unbreaking-riptide` --- ### 📝 Commits (1) - [`4d01167`](https://github.com/horizon-rust/horizon/commit/4d0116762c9a360490cc5c65510f9fd5b552b8b9) Apply Unbreaking to thrown tridents and stop Riptide while riding ### 📊 Changes **2 files changed** (+23 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+18 -0) 📝 `crates/horizon-client/src/game/trident.rs` (+5 -8) </details> ### 📄 Description ## What and why Two small trident bugs: - Throwing a trident added exactly 1 damage and ignored Unbreaking. It now goes through the same durability calculation as every other item, and it still stops at 1 durability left instead of breaking (the throw is refused earlier when the next point of damage would break it). - Riptide launched a player who was riding a boat, minecart or mount. It now needs the player to be in water or rain and not riding. The wear for both throwing and Riptide uses one new helper, `hurt_held_without_breaking`, next to `damage_held` in `game.rs`. It does nothing in creative mode. ## Vanilla reference - `TridentItem.releaseUsing`: `itemStack.hurtWithoutBreaking(1, player)` for both the throw and Riptide, and the Riptide condition `isInWaterOrRain() && !isPassenger()`. - `ItemStack.hurtWithoutBreaking` and `processDurabilityChange`: Unbreaking applies, nothing happens for infinite materials, and the damage is capped at `getMaxDamage() - 1`. - `Entity.isPassenger`. ## 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:20 +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#4053
No description provided.