Skip to content

feat: add PlayerBundleItemSelectEvent#13898

Open
mrtz6 wants to merge 8 commits into
PaperMC:mainfrom
mrtz6:feature/player-bundle-item-select-event
Open

feat: add PlayerBundleItemSelectEvent#13898
mrtz6 wants to merge 8 commits into
PaperMC:mainfrom
mrtz6:feature/player-bundle-item-select-event

Conversation

@mrtz6
Copy link
Copy Markdown

@mrtz6 mrtz6 commented May 20, 2026

Adds a new event that is called when a player selects an item in a bundle.

@mrtz6 mrtz6 requested a review from a team as a code owner May 20, 2026 20:25
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 20, 2026
@mrtz6
Copy link
Copy Markdown
Author

mrtz6 commented May 20, 2026

This pretty much enables listening for scrolling above an item. Here are some usage examples for this event:

rules.mp4
item_browser.mp4

@Owen1212055
Copy link
Copy Markdown
Member

I think it may be better to view this as an inventory event? As then you can instead act on a slot in an inventory so this can be better used in inventory guis.

Also, exposing the previous selected slot would be nice.

@mrtz6
Copy link
Copy Markdown
Author

mrtz6 commented May 21, 2026

Inventory event does make more sense as the supertype for this event: PlayerBundleItemSelectEvent now inherits InventoryEvent. Added slot and previous index/item fields.

masmc05

This comment was marked as outdated.

@Owen1212055
Copy link
Copy Markdown
Member

Owen1212055 commented May 21, 2026

Can this also be made cancellable Also, move most of this logic to craft event factory.

@mrtz6
Copy link
Copy Markdown
Author

mrtz6 commented May 21, 2026

I now moved all of the firing logic to the craft event factory; not sure how the logic could have been split up.

@mrtz6
Copy link
Copy Markdown
Author

mrtz6 commented May 24, 2026

I was thinking: would it maybe be a good addition for the event to expose a getSelectionDelta / getScrollDirection method to simplify the GUI scrolling handling? I'm guessing this event will mainly be used for GUI-related stuff anyway.

@Warriorrrr Warriorrrr added type: feature Request for a new Feature. scope: api labels May 26, 2026
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: Awaiting review

Development

Successfully merging this pull request may close these issues.

4 participants