Skip to content

Conversation

@aerulion
Copy link
Contributor

This fix only allows items that can actually be eaten by the player. For example, since version 1.21.11, fish buckets have also provided the FOOD component, but they cannot be eaten.

I wasn't sure if this was worth dealing with right now, so I asked about it on Discord here, but it seemed to go unnoticed. If PRs aren't welcome yet, please close it; I just didn't want it to be overlooked.

@aerulion aerulion requested a review from a team as a code owner November 26, 2025 20:20
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Nov 26, 2025
Copy link
Contributor

@lynxplay lynxplay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds sensible to me.

@Doc94
Copy link
Member

Doc94 commented Dec 2, 2025

Im not sure what was the "edible" definition when the method was added.. maybe can be good add a note about that? because for me edible can be just consumable.

@Lulu13022002
Copy link
Contributor

Yes, the javadocs could be updated to clear any confusion that it only applies for players

@aerulion
Copy link
Contributor Author

aerulion commented Dec 2, 2025

Im not sure what was the "edible" definition when the method was added.. maybe can be good add a note about that? because for me edible can be just consumable.

But just checking consumable would definitely be a behavior change since it would also include things like Potions, Ominous Bottles, etc., that weren't considered edible before. Also, then one could just use .hasDefaultData(DataComponentTypes.CONSUMABLE), and I wouldn't really see the point of why this component would have its own method while the others don't (although that already has been the case with the old FOOD component check).

But I will add a bit more detailed Javadocs.

This fix only allows items that can actually be eaten by the player. For example, since version 1.21.11, fish buckets have also provided the FOOD component, but they cannot be eaten.
@Owen1212055 Owen1212055 merged commit 1d09b61 into PaperMC:main Dec 3, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting review to Merged in Paper PR Queue Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

5 participants