Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Player#give #11995

Merged
merged 5 commits into from
Jan 26, 2025
Merged

Add Player#give #11995

merged 5 commits into from
Jan 26, 2025

Conversation

masmc05
Copy link
Contributor

@masmc05 masmc05 commented Jan 21, 2025

Closes #11921

Adds a new method that follows full vanilla inventory logic, like first trying to put in main hand, then in off hand, then in the rest inventory. It's also a utility method that supports dropping items if they did not fit to ensure that items are not lost.

@masmc05 masmc05 requested a review from a team as a code owner January 21, 2025 11:25
@Doc94
Copy link
Contributor

Doc94 commented Jan 21, 2025

this not require the update container like the give command?

@masmc05
Copy link
Contributor Author

masmc05 commented Jan 21, 2025

No, broadcast changes is triggered anyway every https://docs.papermc.io/paper/reference/world-configuration#tick_rates_container_update ticks, and usually api doesn't manually trigger updates unlike vanilla, letting it be tracked by tick methods

@Warriorrrr Warriorrrr added type: feature Request for a new Feature. scope: api labels Jan 25, 2025
@lynxplay
Copy link
Contributor

To note for tomorrows review/merge, leftovers are scuffed in creative as the method obviously doesn't drop for creative mode players.
This, I'd argue, is perfectly fine tho given this is supposed to be exactly like vanilla.

@lynxplay lynxplay merged commit 3af5e77 into PaperMC:main Jan 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: api type: feature Request for a new Feature.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

addItem problem with offhand and full inventory
5 participants