[PR #7595] Report the item-use finish vibration when a use ends #7703

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7595
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/use-stop-vibration


📝 Commits (3)

  • f191b09 fix: releasing an item use reports the finish vibration
  • 32eb939 fix: finishing an item use reports the finish vibration too
  • 8012b13 port_map: stopUsingItem is a port, not an inline of the tick

📊 Changes

3 files changed (+32 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+28 -1)
📝 crates/horizon-client/src/game/item_use.rs (+3 -0)
📝 tools/port_map/game-006.tsv (+1 -1)

📄 Description

A use of an item over time ends in LivingEntity.stopUsingItem, and that is
where vanilla reports the interaction with a game event. Horizon never sent it
from either way a use ends, so a released bow, a lowered shield, an aborted
spyglass or a finished meal made no vibration: a sculk sensor next to the player
stayed silent.

Vanilla

javap -p -c -constants net.minecraft.world.entity.LivingEntity:

  • releaseUsingItem() runs the item's releaseUsing and then always calls
    stopUsingItem() (invokevirtual #2021 // Method stopUsingItem:()V, last
    instruction of the method).
  • completeUsingItem() finishes the stack (ItemStack.finishUsingItem) and
    ends with the same stopUsingItem() (invokevirtual #2021, offset 88).
  • stopUsingItem() is
    if (!level.isClientSide) { boolean wasUsing = isUsingItem(); setLivingEntityFlag(1, false); if (wasUsing) this.useItem.causeUseVibration(this, GameEvent.ITEM_INTERACT_FINISH); } this.useItem = ItemStack.EMPTY; this.useItemRemaining = 0;

ItemStack.causeUseVibration(entity, event) reads the stack's USE_EFFECTS
component and only fires when UseEffects.interactVibrations() is true (the
default), and calls Entity.gameEvent(event), which is
level.gameEvent(entity, event, this.position) — the event comes from the
player, at the player's own position.

Horizon

Game::release_used_item (the port of releaseUsingItem, reached by
RELEASE_USE_ITEM, a slot change mid-use and a use running out) ran the item's
own release and left clearing Game::using to its callers;
Game::complete_using_item (the port of completeUsingItem) cleared using
itself. Neither posted a game event, and the only item_interact_finish sites
in the tree were three item-specific ones (game/growth.rs bone meal,
game/totem.rs, game/shelf.rs).

The PR adds the missing tail:

  • Game::stop_using_item is stopUsingItem: drop the use, then vibrate;
  • Game::use_vibration is ItemStack.causeUseVibration: it sends
    minecraft:item_interact_finish at the player's feet only when
    ItemInfo::interact_vibrations (the use_effects.interact_vibrations
    component field) is set, which is where horizon-items already keeps it;
  • release_used_item ends through stop_using_item, and complete_using_item
    ends with use_vibration after the stack's finish (the use-complete packet and
    LivingEntityUseItemEvent.Finish come first, as vanilla orders them).

Proven: the two bytecode tails above (releaseUsingItem and
completeUsingItem both end in stopUsingItem, and stopUsingItem is the only
generic causeUseVibration(ITEM_INTERACT_FINISH) caller). Failing without the
change: a released bow, a finished apple or a lowered shield produces no game
event at all — the fixture log (game/dispense_fixture.rs::record, which
game/sculk.rs::post_game_event writes as G x,y,z <event>) has no line for
them, while bone meal and the totem do; with the change each produces one
G <player feet> minecraft:item_interact_finish. grep -c item_interact_finish
over game/** goes from 3 files to 5, and stop_using_item is the single place
that decides it.

Not proven: no runtime check of a sculk sensor hearing the release: that
needs a live world (.local resources) and the LAN/sculk fixtures, which run in
CI. The port_map row for LivingEntity.stopUsingItem is updated in the same PR
because it described the old inline.


🔄 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/7595 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/use-stop-vibration` --- ### 📝 Commits (3) - [`f191b09`](https://github.com/horizon-rust/horizon/commit/f191b093c50f68894c2aba504f72e47ccbc8579a) fix: releasing an item use reports the finish vibration - [`32eb939`](https://github.com/horizon-rust/horizon/commit/32eb93988b50b6705040c82b4be71467b3b3ddbc) fix: finishing an item use reports the finish vibration too - [`8012b13`](https://github.com/horizon-rust/horizon/commit/8012b13f095de0632041bc18c512fc4252f711bb) port_map: stopUsingItem is a port, not an inline of the tick ### 📊 Changes **3 files changed** (+32 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+28 -1) 📝 `crates/horizon-client/src/game/item_use.rs` (+3 -0) 📝 `tools/port_map/game-006.tsv` (+1 -1) </details> ### 📄 Description A use of an item over time ends in `LivingEntity.stopUsingItem`, and that is where vanilla reports the interaction with a game event. Horizon never sent it from either way a use ends, so a released bow, a lowered shield, an aborted spyglass or a finished meal made no vibration: a sculk sensor next to the player stayed silent. ### Vanilla `javap -p -c -constants net.minecraft.world.entity.LivingEntity`: * `releaseUsingItem()` runs the item's `releaseUsing` and then always calls `stopUsingItem()` (`invokevirtual #2021 // Method stopUsingItem:()V`, last instruction of the method). * `completeUsingItem()` finishes the stack (`ItemStack.finishUsingItem`) and ends with the same `stopUsingItem()` (`invokevirtual #2021`, offset 88). * `stopUsingItem()` is `if (!level.isClientSide) { boolean wasUsing = isUsingItem(); setLivingEntityFlag(1, false); if (wasUsing) this.useItem.causeUseVibration(this, GameEvent.ITEM_INTERACT_FINISH); } this.useItem = ItemStack.EMPTY; this.useItemRemaining = 0;` `ItemStack.causeUseVibration(entity, event)` reads the stack's `USE_EFFECTS` component and only fires when `UseEffects.interactVibrations()` is true (the default), and calls `Entity.gameEvent(event)`, which is `level.gameEvent(entity, event, this.position)` — the event comes from the player, at the player's own position. ### Horizon `Game::release_used_item` (the port of `releaseUsingItem`, reached by RELEASE_USE_ITEM, a slot change mid-use and a use running out) ran the item's own release and left clearing `Game::using` to its callers; `Game::complete_using_item` (the port of `completeUsingItem`) cleared `using` itself. Neither posted a game event, and the only `item_interact_finish` sites in the tree were three item-specific ones (`game/growth.rs` bone meal, `game/totem.rs`, `game/shelf.rs`). The PR adds the missing tail: * `Game::stop_using_item` is `stopUsingItem`: drop the use, then vibrate; * `Game::use_vibration` is `ItemStack.causeUseVibration`: it sends `minecraft:item_interact_finish` at the player's feet only when `ItemInfo::interact_vibrations` (the `use_effects.interact_vibrations` component field) is set, which is where `horizon-items` already keeps it; * `release_used_item` ends through `stop_using_item`, and `complete_using_item` ends with `use_vibration` after the stack's finish (the use-complete packet and `LivingEntityUseItemEvent.Finish` come first, as vanilla orders them). **Proven:** the two bytecode tails above (`releaseUsingItem` and `completeUsingItem` both end in `stopUsingItem`, and `stopUsingItem` is the only generic `causeUseVibration(ITEM_INTERACT_FINISH)` caller). Failing without the change: a released bow, a finished apple or a lowered shield produces no game event at all — the fixture log (`game/dispense_fixture.rs::record`, which `game/sculk.rs::post_game_event` writes as `G x,y,z <event>`) has no line for them, while bone meal and the totem do; with the change each produces one `G <player feet> minecraft:item_interact_finish`. `grep -c item_interact_finish` over `game/**` goes from 3 files to 5, and `stop_using_item` is the single place that decides it. **Not proven:** no runtime check of a sculk sensor hearing the release: that needs a live world (`.local` resources) and the LAN/sculk fixtures, which run in CI. The port_map row for `LivingEntity.stopUsingItem` is updated in the same PR because it described the old inline. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7703
No description provided.