[PR #2259] [MERGED] Fire the levitation and using_item advancement triggers (spyglass looking_at) #4151

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

📋 Pull Request Information

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

Base: main ← Head: fix/levitation-and-spyglass-triggers


📝 Commits (3)

  • 2e64285 Fire the levitation and using_item advancement triggers
  • af49fd7 Use a collision-shape raycast for the spyglass line-of-sight check
  • 86b6514 Merge main into fix/levitation-and-spyglass-triggers (advancements.rs: keep the levitation/using_item triggers and main's hurt triggers)

📊 Changes

4 files changed (+114 additions, -21 deletions)

View changed files

📝 crates/horizon-client/src/advancements.rs (+26 -21)
📝 crates/horizon-client/src/game.rs (+2 -0)
📝 crates/horizon-client/src/game/advancements.rs (+79 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+7 -0)

📄 Description

What and why

"Great View From Up Here" (levitate 50 blocks up) and the spyglass advancements for a parrot and a ghast could not be earned: the levitation and using_item triggers were never fired.

  • levitation: the game remembers where and when levitation started (kept per player, so a guest on a server gets their own) and fires the trigger every tick while it lasts, with the distance and duration it is checked against.
  • using_item: fired every tick the player uses an item. The player predicate's looking_at is now understood: it finds the first mob on a 100 block line from the eyes and needs a clear line to it (the ender dragon is not a regular mob in Horizon, so it is not covered). Before, that field was ignored, so it would have matched anything.

Vanilla reference

  • ServerPlayer.tick, onEffectAdded, onEffectsRemoved (levitationStartPos / levitationStartTime)
  • ServerPlayer.updateUsingItem
  • LevitationTrigger, UsingItemTrigger, DistancePredicate
  • PlayerPredicate.lookingAt
  • end/levitate, adventure/spyglass_at_parrot, spyglass_at_ghast, spyglass_at_dragon

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/2259 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/levitation-and-spyglass-triggers` --- ### 📝 Commits (3) - [`2e64285`](https://github.com/horizon-rust/horizon/commit/2e642857fc36d4b4d2e1148dc0fedf73aead5128) Fire the levitation and using_item advancement triggers - [`af49fd7`](https://github.com/horizon-rust/horizon/commit/af49fd7dc3b7248f47b7f2cf066df183abee353e) Use a collision-shape raycast for the spyglass line-of-sight check - [`86b6514`](https://github.com/horizon-rust/horizon/commit/86b651405ada49613071048143e662a4c3ec7516) Merge main into fix/levitation-and-spyglass-triggers (advancements.rs: keep the levitation/using_item triggers and main's hurt triggers) ### 📊 Changes **4 files changed** (+114 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/advancements.rs` (+26 -21) 📝 `crates/horizon-client/src/game.rs` (+2 -0) 📝 `crates/horizon-client/src/game/advancements.rs` (+79 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+7 -0) </details> ### 📄 Description ## What and why "Great View From Up Here" (levitate 50 blocks up) and the spyglass advancements for a parrot and a ghast could not be earned: the `levitation` and `using_item` triggers were never fired. - `levitation`: the game remembers where and when levitation started (kept per player, so a guest on a server gets their own) and fires the trigger every tick while it lasts, with the distance and duration it is checked against. - `using_item`: fired every tick the player uses an item. The player predicate's `looking_at` is now understood: it finds the first mob on a 100 block line from the eyes and needs a clear line to it (the ender dragon is not a regular mob in Horizon, so it is not covered). Before, that field was ignored, so it would have matched anything. ## Vanilla reference - `ServerPlayer.tick`, `onEffectAdded`, `onEffectsRemoved` (levitationStartPos / levitationStartTime) - `ServerPlayer.updateUsingItem` - `LevitationTrigger`, `UsingItemTrigger`, `DistancePredicate` - `PlayerPredicate.lookingAt` - `end/levitate`, `adventure/spyglass_at_parrot`, `spyglass_at_ghast`, `spyglass_at_dragon` ## 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:15:03 +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#4151
No description provided.