Skip to content

[Fix]clear exhaustion with /feed - #406

Merged
John-Paul-R merged 1 commit into
John-Paul-R:26.xfrom
An16og:Fix#306
Oct 19, 2026
Merged

John-Paul-R merged 1 commit into
John-Paul-R:26.xfrom
An16og:Fix#306

Conversation

@An16og

@An16og An16og commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restores the "clear exhaustion" behavior of /feed, which was lost when Minecraft removed FoodData#setExhaustion.

Fixes #306

Problem

Newer Minecraft versions no longer expose a setter for exhaustion on FoodData; it can only be added to through the public API. FeedCommand had the setExhaustion(0) call commented out, so /feed restored food level and saturation but left any accumulated exhaustion in place.

Changes

  • mixin/FoodDataAccessor.java (new): an @Accessor mixin that exposes a setter for the private exhaustionLevel field of FoodData.
  • essential_commands.mixins.json: registers FoodDataAccessor.
  • FeedCommand.java: calls the accessor to reset exhaustion to 0 after setting food level and saturation, and removes the old commented-out line.

Testing

  • ./gradlew build succeeds
  • Game starts without a mixin error (a wrong field name would fail on startup because defaultRequire is 1)
  • /feed on a player with low food and accumulated exhaustion restores food and saturation, and exhaustion no longer carries over

Notes

The accessor targets the Mojang-mapped field name exhaustionLevel. I couldn't verify it against the target Minecraft version in my environment, so please confirm it during testing.

@John-Paul-R
John-Paul-R merged commit 29df793 into John-Paul-R:26.x Oct 19, 2026
1 check 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.

clear exhaustion with /feed

2 participants