ProtocolLib

3M Downloads

USE_ENTITY 1.18 problem

Dave4245 opened this issue ยท 2 comments

commented

Describe the bug
When trying to create a packet NPC click listener the methods event.getPacket().getEntityUseActions() and event.getPacket().getHands() return empty.

To Reproduce
Here is an image of the code and all useful information:
image

I tried putting the hands if statement first, but that also returned empty.

Expected behavior
For the final if statement to be called.

Version Info
I can't provide it as it is located inside an isolated container.

Additional context
I don't know if I have missed something but I was using version 4.7.0 and the same thing was happening, I also saw a pull request with a fix to this in 1.17 but IDK if that is relevant here as it's 1.18.

commented

For 1.17+ use getEnumEntityUseActions instead (the action wrapper contains the hand as well, but only if the player is not attacking the entity, the server then expects always the use of MAIN_HAND).

commented

Awesome thanks for the help.