[GH-ISSUE #6697] Native mods: a hook for an item frame or painting about to break (a guest's hit does not reach it) #2184

Closed
opened 2026-11-02 15:52:49 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @breachato on GitHub.

🤖 Filed by Detimes' AI agent (Claude Code, Sonnet 5.5), not by Detimes personally.

Part of the hook list in #5816: a native hook for an item frame or painting about to break (a player hits it, an explosion, it loses its wall), cancellable, with the player's state swapped in when a player does it. Nobody has this yet, and I could not finish it, so it is free to take.

What exists (on my fork, branch batch-protection, commit 228113a84, not a PR): native_hanging_break(player: Option<u128>, kind, pos, cancel), asked from frames.rs (frame_break_cancelled: attack_frame, the frame-without-wall check, the explosion path) and paintings.rs (break_painting returns false when cancelled), plus fragment and docs paragraph.

What failed: on a real dedicated server with a throwaway horizon-mixins bundle hooking it, a protocol client hit an item frame (Attack packet on its entity id) and a painting. The frames and paintings were gone afterwards, but the hook never fired (the same bundle's native_hanging_place fired fine). So a guest's hit on a frame or painting reaches a break path that does not go through attack_frame (that one only knows the host's crosshair, frame_hit()), and no other path asks the mods. Where to look: how a guest's Attack on an item-frame or painting entity is handled on the server (lan_actions.rs / lan_entities.rs), and any item_frames.remove / painting removal that skips frame_break_cancelled.

Proof idea for whoever takes it: fresh dedicated server, setblock/summon an item frame and a painting, a bare protocol client sends Attack for each, check that a hook line appears and that cancel keeps the entity.

Originally created by @Detimes on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6697 Originally assigned to: @breachato on GitHub. > 🤖 Filed by Detimes' AI agent (Claude Code, Sonnet 5.5), not by Detimes personally. Part of the hook list in #5816: a native hook for **an item frame or painting about to break** (a player hits it, an explosion, it loses its wall), cancellable, with the player's state swapped in when a player does it. Nobody has this yet, and I could not finish it, so it is free to take. What exists (on my fork, branch `batch-protection`, commit `228113a84`, not a PR): `native_hanging_break(player: Option<u128>, kind, pos, cancel)`, asked from `frames.rs` (`frame_break_cancelled`: `attack_frame`, the frame-without-wall check, the explosion path) and `paintings.rs` (`break_painting` returns false when cancelled), plus fragment and docs paragraph. What failed: on a real dedicated server with a throwaway horizon-mixins bundle hooking it, a protocol client hit an item frame (Attack packet on its entity id) and a painting. The frames and paintings were gone afterwards, but **the hook never fired** (the same bundle's `native_hanging_place` fired fine). So a guest's hit on a frame or painting reaches a break path that does not go through `attack_frame` (that one only knows the host's crosshair, `frame_hit()`), and no other path asks the mods. Where to look: how a guest's `Attack` on an item-frame or painting entity is handled on the server (`lan_actions.rs` / `lan_entities.rs`), and any `item_frames.remove` / painting removal that skips `frame_break_cancelled`. Proof idea for whoever takes it: fresh dedicated server, `setblock`/`summon` an item frame and a painting, a bare protocol client sends Attack for each, check that a hook line appears and that `cancel` keeps the entity.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6572835750 --> @breachato commented on GitHub (Nov 2, 2026): 🤖 Agent: /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#2184
No description provided.