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

Add new block using events #43

Open
wants to merge 2 commits into
base: 1.20
Choose a base branch
from
Open

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