Skip to content

Conversation

Hugman76
Copy link
Member

@Hugman76 Hugman76 commented Aug 7, 2023

The current block use event is called very early, when the player tries to interact with the block. (head of ServerPlayerInteractionManager#interactBlock)
This is before the game checks for player gamemode (spectactor container opening), if it should cancel the interaction (no held item + sneaking) or if the player is holding an item.

I added two new events that fire when a player actually attempts to use a block, or when it attempts to use an item on a block respectively named BlockUseEvent#USE and BlockUseEvent#USE_ITEM. BlockUseEvent#EVENT as been marked as deprecated as it has been renamed BlockUseEvent#INTERACT for clarity

@Patbox
Copy link
Member

Patbox commented Aug 8, 2023

Same as #44 (comment), make sure it's ABI-compatible with previous build (doesn't look so)

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