Skip to content

Sync health and food to clients when interact block secondary event is cancelled#4221

Merged
Yeregorix merged 3 commits intoSpongePowered:api-12from
AlexandreArcil:item-use-fail-update-food-health
Nov 4, 2025
Merged

Sync health and food to clients when interact block secondary event is cancelled#4221
Yeregorix merged 3 commits intoSpongePowered:api-12from
AlexandreArcil:item-use-fail-update-food-health

Conversation

@AlexandreArcil
Copy link
Contributor

Reported by #4122

When right-clicking on a cake and InteractBlockEvent.Secondary is cancelled, the player's hunger level visually increases while on the server the value remains unchanged.
This PR fixes this by resynchronizing the food level when the event is cancelled.

The code is quite similar to what minecraft does in ServerPlayer#doTick.

@Yeregorix Yeregorix merged commit ba9ddbf into SpongePowered:api-12 Nov 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants