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

Item overflow event #11886

Open
JHarris12345 opened this issue Jan 2, 2025 · 1 comment
Open

Item overflow event #11886

JHarris12345 opened this issue Jan 2, 2025 · 1 comment

Comments

@JHarris12345
Copy link

Is your feature request related to a problem?

This is a QOL feature that would make it much easier for plugins to add an "overflow inventory" for items that the player doesn't have enough room for at the time of receiving instead of dropping the item and risk soemone else pick it up / missing it entirely

Describe the solution you'd like.

When an itemstack is added to a player's inventory using inventory.addItem(), if there is anything left in the leftover map, it would be cool to call a form of ItemOverFlowEvent that contains information for the remaining map

Describe alternatives you've considered.

I've not thought of anything that would be as easy to do inside every plugin as this

Other

No response

@electronicboy
Copy link
Member

I dislike the notation of such an event, especially given the lack of a context API. If handled improperly, it would only break other plugins, which could be dangerously destructive to servers. Plugins do not have mechanisms for seeing the context of what is going on to surmise how they'd be able to handle anything properly.

I have a plugin that takes over some operations to put items into a player's inventory and uses the returned map to implement fallback behaviour, which is relevant to what is going on because I have the context of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants