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

[1.21.1][NeoForge 21.1.95] Why doesn't the useitem event pass a 'hand' parameter? #1859

Open
SolarMoonQAQ opened this issue Jan 16, 2025 · 1 comment

Comments

@SolarMoonQAQ
Copy link

Image
I didn't find a way to call hand when using this event., want to know why.🙂

@KnightMiner
Copy link
Contributor

As a workaround, there is always item stack instance comparison. If you have access to the entity, you can check event.getStack() == entity.getItemMainHand() to see if its the main hand item. While .equals() may return true for the item in both hands, the items in each hand are guaranteed to be unique instances.

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

No branches or pull requests

2 participants