Skip to content

feat: add PlayerBundleItemSelectEvent#13898

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

feat: add PlayerBundleItemSelectEvent#13898
mrtz6 wants to merge 4 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

this.player.containerMenu.setSelectedBundleItemIndex(packet.slotId(), packet.selectedItemIndex());
+
+ // Paper start - PlayerBundleItemSelectEvent
+ if (this.player.isCreative() && this.player.containerMenu instanceof net.minecraft.world.inventory.InventoryMenu) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a comment why this is needed
(And maybe open a MJ bug)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added in 0115042. I'm unsure whether this is a bug or behavior intended by Mojang, given how differently creative mode inventory actions are handled.

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

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants