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 item_in_hand and hand fields to block_place event. #1382

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

Lildirt
Copy link
Contributor

@Lildirt Lildirt commented Jun 10, 2024

Adds those two keys to the event array. item_in_hand is a full item stack, whereas hand is just main_hand/off_hand.

@PseudoKnight
Copy link
Contributor

I think 'item_in_hand' could be shortened to just 'item'. What do you think?

Other than that, this looks good to go. I checked and it should work on all supported versions of Paper/Spigot.

@Pieter12345
Copy link
Contributor

I think 'item_in_hand' could be shortened to just 'item'. What do you think?

Other than that, this looks good to go. I checked and it should work on all supported versions of Paper/Spigot.

I want to add the suggestion to use held_item, since it clearly indicates what it represents. But that might not be consistent with most other events using item. You can pick any, I just wanted to add the suggestion.

@Lildirt Lildirt force-pushed the ld/block-place-hand branch from 08f1f57 to e7179d6 Compare June 11, 2024 02:42
@Lildirt
Copy link
Contributor Author

Lildirt commented Jun 11, 2024

I think 'item_in_hand' could be shortened to just 'item'. What do you think?

Other than that, this looks good to go. I checked and it should work on all supported versions of Paper/Spigot.

Good point. Looks like item (vs held_item) is the most consistent for events. Updated the commit to use item instead.

@PseudoKnight PseudoKnight merged commit 76d59a1 into EngineHub:master Jun 11, 2024
2 of 4 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.

3 participants