[GH-ISSUE #4472] Eating/using item continues while an inventory is open #1342

Closed
opened 2026-11-02 15:46:11 +07:00 by bsakaguchi · 16 comments
Owner

Originally created by @kira-horizon[bot] on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4472

Originally assigned to: @CocofireHD on GitHub.

Version: v0.2.97 · OS: not given (copied from the report)

What I did:

  1. Started a singleplayer world
  2. Selected food in the hotbar and held right click until the eating animation started.
  3. While still eating, pressed E to open the inventory.
  4. Left the inventory open (the same happens with a chest or any other GUI screen).

What happened:
The item use does not stop when the screen opens: the player keeps eating/using the item with the inventory open, and the use is never cancelled the way it is in vanilla.

What I expected:
As in vanilla 26.3: opening a screen stops the current item use, so eating is cancelled as soon as a GUI opens.

Does it happen every time?
Yes, every time (reported on Discord and collected in #4383, item 13; not yet re-tested on current main by the reporter of this issue).

Horizon version: v0.2.97, Minecraft 26.3 main 352d59f61, source-compiled

OS, CPU, GPU:
Windows 11
Intel Core i5-13450HX
RTX 3050

Reported on Discord by жека in #horizon-bugs · Discord thread
Tags: gameplay

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @kira-horizon[bot] on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4472 Originally assigned to: @CocofireHD on GitHub. **Version:** v0.2.97 · **OS:** not given <sub>(copied from the report)</sub> > What I did: > 1. Started a singleplayer world > 2. Selected food in the hotbar and held right click until the eating animation started. > 3. While still eating, pressed E to open the inventory. > 4. Left the inventory open (the same happens with a chest or any other GUI screen). > > What happened: > The item use does not stop when the screen opens: the player keeps eating/using the item with the inventory open, and the use is never cancelled the way it is in vanilla. > > What I expected: > As in vanilla 26.3: opening a screen stops the current item use, so eating is cancelled as soon as a GUI opens. > > Does it happen every time? > Yes, every time (reported on Discord and collected in `#4383`, item 13; not yet re-tested on current main by the reporter of this issue). > > Horizon version: v0.2.97, Minecraft 26.3 main 352d59f61, source-compiled > > OS, CPU, GPU: > Windows 11 > Intel Core i5-13450HX > RTX 3050 Reported on Discord by **жека** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1565747419428163745) Tags: gameplay <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:46:11 +07:00
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 30, 2026):

жека added on Discord:

eating while inventory is open

<!-- gh-comment-id:6526517499 --> @kira-horizon[bot] commented on GitHub (Oct 30, 2026): **жека** added on Discord: > eating while inventory is open - [2026-10-30_17.18.04.png](https://cdn.discordapp.com/attachments/1565747419428163745/1565748877825671178/2026-10-30_17.18.04.png?ex=6ae608c6&is=6ae4b746&hm=4cad52b4640fa271ea2a9f70a7ca7fb431195dd4b9f520ef84d8debfd60ec036&) <!-- kira -->
Author
Owner

@CocofireHD commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6527684988 --> @CocofireHD commented on GitHub (Oct 30, 2026): /claim
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game.

Checked against the pinned client jar:

  • python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem → exactly one caller, Minecraft.handleKeybinds, coverage: complete.
  • Minecraft.tick calls handleKeybinds() only when gui.overlay() == null && gui.screen() == null. With a screen open it only sets missTime = 10000; gameMode.tick() and level.tickEntities() keep running, so LivingEntity.updatingUsingItem keeps counting down and the food is consumed behind the inventory.
  • The release happens on the first tick after the screen closes, if the use is still running and the use key isn't held (handleKeybinds, !keyUse.isDown()). That is also why a drawn bow fires when the inventory closes, not when it opens.

The horizon-ctl measurement in #4498 shows the same end state on main: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, status.using null. The PR that changed this has been closed.

If someone can reproduce a different behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug.

(A maintainer will need to close it — this account is read-only on the repository.)

<!-- gh-comment-id:6540391384 --> @CocofireHD commented on GitHub (Oct 31, 2026): 🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game. Checked against the pinned client jar: - `python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem` → exactly one caller, `Minecraft.handleKeybinds`, `coverage: complete`. - `Minecraft.tick` calls `handleKeybinds()` only when `gui.overlay() == null && gui.screen() == null`. With a screen open it only sets `missTime = 10000`; `gameMode.tick()` and `level.tickEntities()` keep running, so `LivingEntity.updatingUsingItem` keeps counting down and the food is consumed behind the inventory. - The release happens on the first tick *after* the screen closes, if the use is still running and the use key isn't held (`handleKeybinds`, `!keyUse.isDown()`). That is also why a drawn bow fires when the inventory closes, not when it opens. The `horizon-ctl` measurement in #4498 shows the same end state on `main`: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, `status.using` null. The PR that changed this has been closed. If someone can reproduce a *different* behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug. (A maintainer will need to close it — this account is read-only on the repository.)
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

@rdbtCVS

<!-- gh-comment-id:6540650311 --> @CocofireHD commented on GitHub (Oct 31, 2026): @rdbtCVS
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game.

Checked against the pinned client jar:

  • python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem → exactly one caller, Minecraft.handleKeybinds, coverage: complete.
  • Minecraft.tick calls handleKeybinds() only when gui.overlay() == null && gui.screen() == null. With a screen open it only sets missTime = 10000; gameMode.tick() and level.tickEntities() keep running, so LivingEntity.updatingUsingItem keeps counting down and the food is consumed behind the inventory.
  • The release happens on the first tick after the screen closes, if the use is still running and the use key isn't held (handleKeybinds, !keyUse.isDown()). That is also why a drawn bow fires when the inventory closes, not when it opens.

The horizon-ctl measurement in #4498 shows the same end state on main: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, status.using null. The PR that changed this has been closed.

If someone can reproduce a different behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug.

(A maintainer will need to close it — this account is read-only on the repository.)

Re-tested in vanilla Minecraft 26.3 (F3 with "26.3/vanilla" visible at the top right of the attached video). Survival mode, a stack of 64 enchanted golden apples.

Control: eating one apple to the end with the inventory closed gives the "Burp" sound, the effects, and the stack goes 64 -> 63.

Then I start eating and open the inventory about 0.7-0.9 s into the 1.6 s use, three times (4.6 s, 7.1 s and 10.4 s in the video, the last time with the inventory kept open for about 4 s). Each time the eating sounds stop within 0.2 s of the screen opening, nothing continues behind the inventory, and the stack stays at 63. So in vanilla the use is cancelled when the inventory opens, which differs from the 8 -> 7 measurement in #4498 and from the analysis above.

Could a maintainer please check this and reopen? I can provide more footage if needed.

https://github.com/user-attachments/assets/8a464261-e827-4276-93b9-6908f328976b

<!-- gh-comment-id:6542420263 --> @posok124521 commented on GitHub (Oct 31, 2026): > 🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game. > > Checked against the pinned client jar: > > * `python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem` → exactly one caller, `Minecraft.handleKeybinds`, `coverage: complete`. > * `Minecraft.tick` calls `handleKeybinds()` only when `gui.overlay() == null && gui.screen() == null`. With a screen open it only sets `missTime = 10000`; `gameMode.tick()` and `level.tickEntities()` keep running, so `LivingEntity.updatingUsingItem` keeps counting down and the food is consumed behind the inventory. > * The release happens on the first tick _after_ the screen closes, if the use is still running and the use key isn't held (`handleKeybinds`, `!keyUse.isDown()`). That is also why a drawn bow fires when the inventory closes, not when it opens. > > The `horizon-ctl` measurement in [#4498](https://github.com/horizon-rust/horizon/pull/4498) shows the same end state on `main`: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, `status.using` null. The PR that changed this has been closed. > > If someone can reproduce a _different_ behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug. > > (A maintainer will need to close it — this account is read-only on the repository.) Re-tested in vanilla Minecraft 26.3 (F3 with "26.3/vanilla" visible at the top right of the attached video). Survival mode, a stack of 64 enchanted golden apples. Control: eating one apple to the end with the inventory closed gives the "Burp" sound, the effects, and the stack goes 64 -> 63. Then I start eating and open the inventory about 0.7-0.9 s into the 1.6 s use, three times (4.6 s, 7.1 s and 10.4 s in the video, the last time with the inventory kept open for about 4 s). Each time the eating sounds stop within 0.2 s of the screen opening, nothing continues behind the inventory, and the stack stays at 63. So in vanilla the use is cancelled when the inventory opens, which differs from the 8 -> 7 measurement in #4498 and from the analysis above. Could a maintainer please check this and reopen? I can provide more footage if needed. https://github.com/user-attachments/assets/8a464261-e827-4276-93b9-6908f328976b
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

but in horizon minecraft eating dont stops

<!-- gh-comment-id:6542434824 --> @posok124521 commented on GitHub (Oct 31, 2026): but in horizon minecraft eating dont stops
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game.
Checked against the pinned client jar:

  • python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem → exactly one caller, Minecraft.handleKeybinds, coverage: complete.
  • Minecraft.tick calls handleKeybinds() only when gui.overlay() == null && gui.screen() == null. With a screen open it only sets missTime = 10000; gameMode.tick() and level.tickEntities() keep running, so LivingEntity.updatingUsingItem keeps counting down and the food is consumed behind the inventory.
  • The release happens on the first tick after the screen closes, if the use is still running and the use key isn't held (handleKeybinds, !keyUse.isDown()). That is also why a drawn bow fires when the inventory closes, not when it opens.

The horizon-ctl measurement in #4498 shows the same end state on main: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, status.using null. The PR that changed this has been closed.
If someone can reproduce a different behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug.
(A maintainer will need to close it — this account is read-only on the repository.)

Re-tested in vanilla Minecraft 26.3 (F3 with "26.3/vanilla" visible at the top right of the attached video). Survival mode, a stack of 64 enchanted golden apples.

Control: eating one apple to the end with the inventory closed gives the "Burp" sound, the effects, and the stack goes 64 -> 63.

Then I start eating and open the inventory about 0.7-0.9 s into the 1.6 s use, three times (4.6 s, 7.1 s and 10.4 s in the video, the last time with the inventory kept open for about 4 s). Each time the eating sounds stop within 0.2 s of the screen opening, nothing continues behind the inventory, and the stack stays at 63. So in vanilla the use is cancelled when the inventory opens, which differs from the 8 -> 7 measurement in #4498 and from the analysis above.

Could a maintainer please check this and reopen? I can provide more footage if needed.

Minecraft.2026.10.31.-.12.42.53.05.DVR.-.Trim.-.Trim.mp4

eating in horizon, the discrepancies are obvious

https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing

<!-- gh-comment-id:6542682021 --> @posok124521 commented on GitHub (Oct 31, 2026): > > 🤖 Agent: This is vanilla 26.3 behaviour, not a Horizon bug, so it should be closed. The expected result in the report doesn't match the game. > > Checked against the pinned client jar: > > > > * `python3 tools/rea_vanilla.py callers net.minecraft.client.multiplayer.MultiPlayerGameMode releaseUsingItem` → exactly one caller, `Minecraft.handleKeybinds`, `coverage: complete`. > > * `Minecraft.tick` calls `handleKeybinds()` only when `gui.overlay() == null && gui.screen() == null`. With a screen open it only sets `missTime = 10000`; `gameMode.tick()` and `level.tickEntities()` keep running, so `LivingEntity.updatingUsingItem` keeps counting down and the food is consumed behind the inventory. > > * The release happens on the first tick _after_ the screen closes, if the use is still running and the use key isn't held (`handleKeybinds`, `!keyUse.isDown()`). That is also why a drawn bow fires when the inventory closes, not when it opens. > > > > The `horizon-ctl` measurement in [#4498](https://github.com/horizon-rust/horizon/pull/4498) shows the same end state on `main`: 8 golden apples, inventory opened 0.7 s into a 1.6 s use and held open 2.5 s → stack 8 → 7, `status.using` null. The PR that changed this has been closed. > > If someone can reproduce a _different_ behaviour — a use that starts while a screen is open, or one that is cancelled by the screen — please reopen with that repro; that would be the real bug. > > (A maintainer will need to close it — this account is read-only on the repository.) > > Re-tested in vanilla Minecraft 26.3 (F3 with "26.3/vanilla" visible at the top right of the attached video). Survival mode, a stack of 64 enchanted golden apples. > > Control: eating one apple to the end with the inventory closed gives the "Burp" sound, the effects, and the stack goes 64 -> 63. > > Then I start eating and open the inventory about 0.7-0.9 s into the 1.6 s use, three times (4.6 s, 7.1 s and 10.4 s in the video, the last time with the inventory kept open for about 4 s). Each time the eating sounds stop within 0.2 s of the screen opening, nothing continues behind the inventory, and the stack stays at 63. So in vanilla the use is cancelled when the inventory opens, which differs from the 8 -> 7 measurement in [#4498](https://github.com/horizon-rust/horizon/pull/4498) and from the analysis above. > > Could a maintainer please check this and reopen? I can provide more footage if needed. > > Minecraft.2026.10.31.-.12.42.53.05.DVR.-.Trim.-.Trim.mp4 eating in horizon, the discrepancies are obvious https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing
Author
Owner

@levzzz5154 commented on GitHub (Oct 31, 2026):

guys this isn't vanilla behaviour actually 😭 (written by levzzz5154 himself not his claude code)

<!-- gh-comment-id:6542930502 --> @levzzz5154 commented on GitHub (Oct 31, 2026): guys this isn't vanilla behaviour actually 😭 (written by levzzz5154 himself not his claude code)
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

Hi @CocofireHD, I reopened this after finding that the "vanilla keeps eating" conclusion misses one step: in 26.3, Minecraft.handleKeybinds opens the inventory (gui.setScreen) and then, in the same call, reaches the isUsingItem/releaseUsingItem check; Gui.setScreen calls KeyMapping.releaseAll(), so keyUse.isDown() is already false and vanilla sends RELEASE_USE_ITEM in that tick. I measured both clients: vanilla never finishes the apple behind an open inventory, Horizon does (details in my comment above). Your PR #4498 looks right to me. Are you planning to continue it? If not, I'd like to take the fix, with a harness. I won't start coding until you answer.

<!-- gh-comment-id:6543116614 --> @posok124521 commented on GitHub (Oct 31, 2026): Hi @CocofireHD, I reopened this after finding that the "vanilla keeps eating" conclusion misses one step: in 26.3, Minecraft.handleKeybinds opens the inventory (gui.setScreen) and then, in the same call, reaches the isUsingItem/releaseUsingItem check; Gui.setScreen calls KeyMapping.releaseAll(), so keyUse.isDown() is already false and vanilla sends RELEASE_USE_ITEM in that tick. I measured both clients: vanilla never finishes the apple behind an open inventory, Horizon does (details in my comment above). Your PR #4498 looks right to me. Are you planning to continue it? If not, I'd like to take the fix, with a harness. I won't start coding until you answer.
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

Alright, if cocofirehd doesn't responding so i`ll take this task /claim

<!-- gh-comment-id:6549286627 --> @posok124521 commented on GitHub (Oct 31, 2026): Alright, if cocofirehd doesn't responding so i`ll take this task /claim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

🤖 Claims: refused, @CocofireHD already claimed this issue: pick another, or ask them here. (asked by @posok124521)

<!-- gh-comment-id:6549295504 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): 🤖 Claims: refused, @CocofireHD already claimed this issue: pick another, or ask them here. (asked by @posok124521)
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

@posok124521 Sorry I somehow didn't get notified that you commented. The issue is yours^^

<!-- gh-comment-id:6549367932 --> @CocofireHD commented on GitHub (Oct 31, 2026): @posok124521 Sorry I somehow didn't get notified that you commented. The issue is yours^^
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

oh, i was just about to tag you again and ask you to pass it to me, thank you^^

<!-- gh-comment-id:6549385424 --> @posok124521 commented on GitHub (Oct 31, 2026): oh, i was just about to tag you again and ask you to pass it to me, thank you^^
Author
Owner

@kacpherek commented on GitHub (Oct 31, 2026):

Closing: this matches vanilla 26.3. Gui.setScreen only calls KeyMapping.releaseAll, and MultiPlayerGameMode.releaseUsingItem runs from Minecraft.handleKeybinds, which does not run while a screen is open, so eating or drawing a bow keeps going when an inventory opens. If you see something different from vanilla here, please reopen with the steps.

<!-- gh-comment-id:6549692176 --> @kacpherek commented on GitHub (Oct 31, 2026): Closing: this matches vanilla 26.3. `Gui.setScreen` only calls `KeyMapping.releaseAll`, and `MultiPlayerGameMode.releaseUsingItem` runs from `Minecraft.handleKeybinds`, which does not run while a screen is open, so eating or drawing a bow keeps going when an inventory opens. If you see something different from vanilla here, please reopen with the steps.
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

Hey @kacpherek, thanks for looking into it, but I think the closing reason misses one small thing, so please reopen 🙏

You're right that handleKeybinds doesn't run on the NEXT ticks while a screen is open. But the inventory gets opened INSIDE handleKeybinds, and the release check is later in the same call (26.3, from tools/rea_vanilla.py):

while (options.keyInventory.consumeClick()) {
    gui.setScreen(new InventoryScreen(player));   // Gui.setScreen -> KeyMapping.releaseAll()
}
...
if (player.isUsingItem()) {
    if (!options.keyUse.isDown()) {               // already false after releaseAll()
        gameMode.releaseUsingItem(player);        // sends RELEASE_USE_ITEM
    }
}

KeyMapping.release() is just clickCount = 0; setDown(false), so keyUse.isDown() is already false when the check runs. So vanilla stops using the item in the same tick you press E. Same for chat and the advancements screen (they also open from handleKeybinds). It does NOT apply to pause or to chests opened by the server, I left those alone.

Proof, so you don't have to take my word for it:

  • Vanilla video (F3 says 26.3/vanilla): I start eating, open the inventory, and the apple count never goes down: [video]
  • Horizon video (F3 says 26.3/horizon): same thing, but the apple is eaten while the inventory is open: [video]
  • Horizon server-tick log: inventory opened at tick 4837, stack went 64 -> 63 at tick 4862 with the GUI still open, regeneration + absorption applied behind it. In vanilla it stays 64.
  • Mojira MC-309593: "If the player starts eating and opens the normal inventory, the eat process is interrupted."

I already have a PR for it (#5511) with the fix and a parity harness. The harness runs the real shipped Minecraft.handleKeybinds in the vanilla oracle, so the order is checked by code, not by reading. If you still see a hole in this, tell me where and I'll happily check it.

https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing <--- NOT vanilla behaviour

https://drive.google.com/file/d/1ASLnTjMdnl95Geht4WBJdTdHKazluqkh/view?usp=sharing <--- vanilla behaviour

<!-- gh-comment-id:6549837484 --> @posok124521 commented on GitHub (Oct 31, 2026): Hey @kacpherek, thanks for looking into it, but I think the closing reason misses one small thing, so please reopen 🙏 You're right that handleKeybinds doesn't run on the NEXT ticks while a screen is open. But the inventory gets opened INSIDE handleKeybinds, and the release check is later in the same call (26.3, from tools/rea_vanilla.py): while (options.keyInventory.consumeClick()) { gui.setScreen(new InventoryScreen(player)); // Gui.setScreen -> KeyMapping.releaseAll() } ... if (player.isUsingItem()) { if (!options.keyUse.isDown()) { // already false after releaseAll() gameMode.releaseUsingItem(player); // sends RELEASE_USE_ITEM } } KeyMapping.release() is just clickCount = 0; setDown(false), so keyUse.isDown() is already false when the check runs. So vanilla stops using the item in the same tick you press E. Same for chat and the advancements screen (they also open from handleKeybinds). It does NOT apply to pause or to chests opened by the server, I left those alone. Proof, so you don't have to take my word for it: - Vanilla video (F3 says 26.3/vanilla): I start eating, open the inventory, and the apple count never goes down: [video] - Horizon video (F3 says 26.3/horizon): same thing, but the apple is eaten while the inventory is open: [video] - Horizon server-tick log: inventory opened at tick 4837, stack went 64 -> 63 at tick 4862 with the GUI still open, regeneration + absorption applied behind it. In vanilla it stays 64. - Mojira MC-309593: "If the player starts eating and opens the normal inventory, the eat process is interrupted." I already have a PR for it (#5511) with the fix and a parity harness. The harness runs the real shipped Minecraft.handleKeybinds in the vanilla oracle, so the order is checked by code, not by reading. If you still see a hole in this, tell me where and I'll happily check it. https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing <--- NOT vanilla behaviour https://drive.google.com/file/d/1ASLnTjMdnl95Geht4WBJdTdHKazluqkh/view?usp=sharing <--- vanilla behaviour
Author
Owner

@posok124521 commented on GitHub (Oct 31, 2026):

Hey @kacpherek, thanks for looking into it, but I think the closing reason misses one small thing, so please reopen 🙏

You're right that handleKeybinds doesn't run on the NEXT ticks while a screen is open. But the inventory gets opened INSIDE handleKeybinds, and the release check is later in the same call (26.3, from tools/rea_vanilla.py):

while (options.keyInventory.consumeClick()) {
    gui.setScreen(new InventoryScreen(player));   // Gui.setScreen -> KeyMapping.releaseAll()
}
...
if (player.isUsingItem()) {
    if (!options.keyUse.isDown()) {               // already false after releaseAll()
        gameMode.releaseUsingItem(player);        // sends RELEASE_USE_ITEM
    }
}

KeyMapping.release() is just clickCount = 0; setDown(false), so keyUse.isDown() is already false when the check runs. So vanilla stops using the item in the same tick you press E. Same for chat and the advancements screen (they also open from handleKeybinds). It does NOT apply to pause or to chests opened by the server, I left those alone.

Proof, so you don't have to take my word for it:

  • Vanilla video (F3 says 26.3/vanilla): I start eating, open the inventory, and the apple count never goes down: [video]
  • Horizon video (F3 says 26.3/horizon): same thing, but the apple is eaten while the inventory is open: [video]
  • Horizon server-tick log: inventory opened at tick 4837, stack went 64 -> 63 at tick 4862 with the GUI still open, regeneration + absorption applied behind it. In vanilla it stays 64.
  • Mojira MC-309593: "If the player starts eating and opens the normal inventory, the eat process is interrupted."

I already have a PR for it (#5511) with the fix and a parity harness. The harness runs the real shipped Minecraft.handleKeybinds in the vanilla oracle, so the order is checked by code, not by reading. If you still see a hole in this, tell me where and I'll happily check it.

https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing <--- NOT vanilla behaviour

https://drive.google.com/file/d/1ASLnTjMdnl95Geht4WBJdTdHKazluqkh/view?usp=sharing <--- vanilla behaviour

@rdbtCVS

<!-- gh-comment-id:6549965679 --> @posok124521 commented on GitHub (Oct 31, 2026): > Hey [@kacpherek](https://github.com/kacpherek), thanks for looking into it, but I think the closing reason misses one small thing, so please reopen 🙏 > > You're right that handleKeybinds doesn't run on the NEXT ticks while a screen is open. But the inventory gets opened INSIDE handleKeybinds, and the release check is later in the same call (26.3, from tools/rea_vanilla.py): > > ``` > while (options.keyInventory.consumeClick()) { > gui.setScreen(new InventoryScreen(player)); // Gui.setScreen -> KeyMapping.releaseAll() > } > ... > if (player.isUsingItem()) { > if (!options.keyUse.isDown()) { // already false after releaseAll() > gameMode.releaseUsingItem(player); // sends RELEASE_USE_ITEM > } > } > ``` > > KeyMapping.release() is just clickCount = 0; setDown(false), so keyUse.isDown() is already false when the check runs. So vanilla stops using the item in the same tick you press E. Same for chat and the advancements screen (they also open from handleKeybinds). It does NOT apply to pause or to chests opened by the server, I left those alone. > > Proof, so you don't have to take my word for it: > > * Vanilla video (F3 says 26.3/vanilla): I start eating, open the inventory, and the apple count never goes down: [video] > * Horizon video (F3 says 26.3/horizon): same thing, but the apple is eaten while the inventory is open: [video] > * Horizon server-tick log: inventory opened at tick 4837, stack went 64 -> 63 at tick 4862 with the GUI still open, regeneration + absorption applied behind it. In vanilla it stays 64. > * Mojira MC-309593: "If the player starts eating and opens the normal inventory, the eat process is interrupted." > > I already have a PR for it ([#5511](https://github.com/horizon-rust/horizon/pull/5511)) with the fix and a parity harness. The harness runs the real shipped Minecraft.handleKeybinds in the vanilla oracle, so the order is checked by code, not by reading. If you still see a hole in this, tell me where and I'll happily check it. > > https://drive.google.com/file/d/1L7AvQwkHLUk0FQfFxunbHUP-F4ROZSRw/view?usp=sharing <--- NOT vanilla behaviour > > https://drive.google.com/file/d/1ASLnTjMdnl95Geht4WBJdTdHKazluqkh/view?usp=sharing <--- vanilla behaviour @rdbtCVS
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#1342
No description provided.