Skip to content

Missing event when middle mouse click on a block/entity#4219

Merged
Yeregorix merged 1 commit intoSpongePowered:api-14from
AlexandreArcil:pick_block_entity_middle_click_event
Sep 15, 2025
Merged

Missing event when middle mouse click on a block/entity#4219
Yeregorix merged 1 commit intoSpongePowered:api-14from
AlexandreArcil:pick_block_entity_middle_click_event

Conversation

@AlexandreArcil
Copy link
Contributor

Issue #4171

Bug

When performing a middle mouse click in creative mode on a block or an entity, the warning Logged slot transactions without event! 1 net.minecraft.world.inventory.InventoryMenu followed by an exception was printed in the console.

Fix

Log a click container transaction when the player picks a block or an entity.

Notes

buttonNum is set to 0 because the packet doesn't contain this information, but the value is not used in MiddleInventoryClickState.
I wanted to add the mixin before the broadcastChanges but the slot number was not available at that point (I don't know why), so I added it after findSlotMatchingItem.
I acknowledge that the instanceof in ClickMenuTransaction is not very clean but I wanted to minimize code changes.

@Yeregorix Yeregorix merged commit b7148cc into SpongePowered:api-14 Sep 15, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants