[GH-ISSUE #2471] Player keeps eating animation after having full food bar #637

Closed
opened 2026-11-02 15:40:43 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2471

What I did: Eat a melon
What happened: After eating a melon to fill food bar, it kept playing the eating animation after I had full food bar
What I expected: Don't restart the animation after food bar is full
Horizon version: v0.2.58
OS, CPU, GPU: CachyOS x86_64, AMD Ryzen 9 9950X3D (32) @ 5.76 GHz, NVIDIA GeForce RTX 5090 [Discrete]

Reported on Discord by patrick in #horizon-bugs · Discord thread
Tags: gameplay

Attachments (Discord links expire after a while; the thread keeps them)

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

Originally created by @ludovic111 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2471 > What I did: Eat a melon > What happened: After eating a melon to fill food bar, it kept playing the eating animation after I had full food bar > What I expected: Don't restart the animation after food bar is full > Horizon version: v0.2.58 > OS, CPU, GPU: CachyOS x86_64, AMD Ryzen 9 9950X3D (32) @ 5.76 GHz, NVIDIA GeForce RTX 5090 [Discrete] Reported on Discord by **patrick** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1564362812015255613) Tags: gameplay **Attachments** (Discord links expire after a while; the thread keeps them) - [Screencast_20261026_203745.webm](https://cdn.discordapp.com/attachments/1564362812015255613/1564362812615168091/Screencast_20261026_203745.webm?ex=6ae0fde6&is=6adfac66&hm=348b451a33d464a072453dedc40154660eeadde8264a03ce562cf150547f6e30&) <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:40:43 +07:00
Author
Owner

@Louistuis commented on GitHub (Oct 26, 2026):

🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Taking this one. Likely cause on the server thread: the client's eating animation finishes but the client never eats the food itself (vanilla's FoodProperties.onConsume runs on the client too), so its food stays below 20 until the server's SetHealth arrives and a held right click starts another bite. I'll confirm against the decompiled source, reproduce, and open a PR.

<!-- gh-comment-id:6425738448 --> @Louistuis commented on GitHub (Oct 26, 2026): 🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Taking this one. Likely cause on the server thread: the client's eating animation finishes but the client never eats the food itself (vanilla's FoodProperties.onConsume runs on the client too), so its food stays below 20 until the server's SetHealth arrives and a held right click starts another bite. I'll confirm against the decompiled source, reproduce, and open a PR.
Author
Owner

@ludovic111 commented on GitHub (Oct 26, 2026):

patrick added on Discord:

yeah the price of the gpu is funny af now

i bought it for 3 something, now its 7.5 or something similar (euro)

<!-- gh-comment-id:6425994916 --> @ludovic111 commented on GitHub (Oct 26, 2026): **patrick** added on Discord: > yeah the price of the gpu is funny af now > i bought it for 3 something, now its 7.5 or something similar (euro) <!-- kira -->
Author
Owner

@ludovic111 commented on GitHub (Oct 26, 2026):

patrick added on Discord:

oh just saw i put the wrong horizon version, its "v0.2.73"

<!-- gh-comment-id:6426195602 --> @ludovic111 commented on GitHub (Oct 26, 2026): **patrick** added on Discord: > oh just saw i put the wrong horizon version, its "v0.2.73" <!-- kira -->
Author
Owner

@ludovic111 commented on GitHub (Oct 26, 2026):

patrick added on Discord:

thats crazy

<!-- gh-comment-id:6426408730 --> @ludovic111 commented on GitHub (Oct 26, 2026): **patrick** added on Discord: > thats crazy <!-- kira -->
Author
Owner

@Louistuis commented on GitHub (Oct 26, 2026):

🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Update: the fix is done and in final testing, PR coming shortly. The server now sends the player USE_ITEM_COMPLETE (entity event 9) and the client eats the food itself, as vanilla's Player.handleEntityEvent(9) does. A new lan_e2e check (eat_full) fails on main and passes with the fix.

<!-- gh-comment-id:6428637150 --> @Louistuis commented on GitHub (Oct 26, 2026): 🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Update: the fix is done and in final testing, PR coming shortly. The server now sends the player USE_ITEM_COMPLETE (entity event 9) and the client eats the food itself, as vanilla's Player.handleEntityEvent(9) does. A new lan_e2e check (eat_full) fails on main and passes with the fix.
Author
Owner

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

🤖 Agent: I reproduced this on the current main and checked the fix that is already in flight in #2564 (Louistuis, open and mergeable). It does fix the reported behaviour, so I am not opening a competing pull request; here is the evidence.

Reproduced on main (a build of main, single player on its server thread, horizon-ctl driving the game). The using field of horizon-ctl state is the item use in progress; food is the food bar.

Holding right click on melon slices with an empty bar:

t=1  using={'slot': 0, 'ticks': 21}  food=0
t=2  using={'slot': 0, 'ticks': 9}   food=2
t=3  using={'slot': 0, 'ticks': 30}  food=2
...
t=14 using={'slot': 0, 'ticks': 5}   food=18
t=15 using=None                       food=18
t=16 using=None                       food=18

The bar stalls at 18 and the eating stops although melon slices are left in hand. And on a nearly full bar, the animation restarts after the bar is full:

t=1 using={'slot': 1, 'ticks': 21}  food=18
t=2 using={'slot': 1, 'ticks': 9}   food=20
t=3 using={'slot': 1, 'ticks': 31}  food=20     <- a new bite after the bar was full
t=4 using=None                       food=20

That is the report: the eating animation goes on after the food bar is full.

With #2564 (I built its branch, 64cd55cf, and ran the same melon scenario):

t=14 using={'slot': 0, 'ticks': 3}   food=18
t=15 using={'slot': 0, 'ticks': 24}  food=18
t=16 using=None                       food=20

The bar fills to 20 and the use ends with it; no bite starts after the bar is full.

The root cause is that the window ends a consumable's use on its own timer and never eats the food itself, so its FoodData waits for the server's next ClientboundSetHealth. With the button still held the next use then sees a bar below 20 and begins another bite.

Vanilla never ends a use by itself: LivingEntity.updateUsingItem completes it only on the server, ServerPlayer.completeUsingItem first sends the player entity event 9 (USE_ITEM_COMPLETE), and Player.handleEntityEvent(9) runs completeUsingItem on the client, where Consumable.onConsume calls the FoodProperties listener on both sides, so FoodProperties.onConsume -> FoodData.eat fills the client's bar at once. #2564 does the same.

Vanilla classes and methods behind this: LivingEntity.updateUsingItem, LivingEntity.completeUsingItem, ServerPlayer.completeUsingItem, Player.handleEntityEvent (case 9), Consumable.startConsuming, Consumable.onConsume, FoodProperties.onConsume, FoodData.eat, Player.canEat.

I cannot close this issue (no permission on the upstream repository), so I leave it open for a maintainer.

<!-- gh-comment-id:6433941594 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: I reproduced this on the current `main` and checked the fix that is already in flight in #2564 (Louistuis, open and mergeable). It does fix the reported behaviour, so I am not opening a competing pull request; here is the evidence. **Reproduced on `main`** (a build of `main`, single player on its server thread, `horizon-ctl` driving the game). The `using` field of `horizon-ctl state` is the item use in progress; `food` is the food bar. Holding right click on melon slices with an empty bar: ``` t=1 using={'slot': 0, 'ticks': 21} food=0 t=2 using={'slot': 0, 'ticks': 9} food=2 t=3 using={'slot': 0, 'ticks': 30} food=2 ... t=14 using={'slot': 0, 'ticks': 5} food=18 t=15 using=None food=18 t=16 using=None food=18 ``` The bar stalls at 18 and the eating stops although melon slices are left in hand. And on a nearly full bar, the animation **restarts** after the bar is full: ``` t=1 using={'slot': 1, 'ticks': 21} food=18 t=2 using={'slot': 1, 'ticks': 9} food=20 t=3 using={'slot': 1, 'ticks': 31} food=20 <- a new bite after the bar was full t=4 using=None food=20 ``` That is the report: the eating animation goes on after the food bar is full. **With #2564** (I built its branch, `64cd55cf`, and ran the same melon scenario): ``` t=14 using={'slot': 0, 'ticks': 3} food=18 t=15 using={'slot': 0, 'ticks': 24} food=18 t=16 using=None food=20 ``` The bar fills to 20 and the use ends with it; no bite starts after the bar is full. The root cause is that the window ends a consumable's use on its own timer and never eats the food itself, so its `FoodData` waits for the server's next `ClientboundSetHealth`. With the button still held the next use then sees a bar below 20 and begins another bite. Vanilla never ends a use by itself: `LivingEntity.updateUsingItem` completes it only on the server, `ServerPlayer.completeUsingItem` first sends the player entity event 9 (`USE_ITEM_COMPLETE`), and `Player.handleEntityEvent(9)` runs `completeUsingItem` on the client, where `Consumable.onConsume` calls the `FoodProperties` listener on both sides, so `FoodProperties.onConsume` -> `FoodData.eat` fills the client's bar at once. #2564 does the same. Vanilla classes and methods behind this: `LivingEntity.updateUsingItem`, `LivingEntity.completeUsingItem`, `ServerPlayer.completeUsingItem`, `Player.handleEntityEvent` (case 9), `Consumable.startConsuming`, `Consumable.onConsume`, `FoodProperties.onConsume`, `FoodData.eat`, `Player.canEat`. I cannot close this issue (no permission on the upstream repository), so I leave it open for a maintainer.
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#637
No description provided.