ProtocolLib

3M Downloads

PacketContainer#getEntityUseActions().read(0); throws an Exception

Opened this issue ยท 1 comments

commented

The PacketContainer.getEntityUseActions().read(0); method throws an Exception in Minecraft 1.17

You can reproduce the error by adding a PacketListener and checking if the packet is equal to a "PacketPlayInUseEntity" packet, if that's the case, you have to get the Actions, after that it throws the exception.

The method should return the use action of the packet (EntityUseAction).

I don't have any screenshots but here's the log (only the error):
https://paste.gg/p/anonymous/84948d55dd2647d8b0750b94f08e678d

I used the last release of ProtocolLib (4.7.0)

I tried to recode the ArtMap plugin for the new 1.17 Update, it used that function of ProtocolLib, I realized that they obfuscated some variables in the newset 1.17 NMS (compared to spigot 1.16).

commented

try PacketContainer#getEnumEntityUseActions().read(0).getAction()

iirc that is what solved it for me