ProtocolLib

3M Downloads

Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet

OakLoaf opened this issue ยท 1 comments

commented

Describe the question
I am unsure how to send packets to make the appear to swing their main arm, I have spent a few hours on this, and read multiple ProtocolLib guides and am feeling rather silly so thought I'd ask for help.

API method(s) used
I have tried many and none have worked, mainly revolving around PacketType.Play.Client.ARM_ANIMATION and PacketType.Play.Client.ENTITY_ACTION

commented

I was using this incorrectly, the correct code is below:
`PacketContainer armAnimation = new PacketContainer(PacketType.Play.Server.ANIMATION);
armAnimation.getIntegers()
.write(0, player.getEntityId())
.write(1, 0);

try {
protocolManager.sendServerPacket(player, armAnimation);
} catch (InvocationTargetException e) {
e.printStackTrace();
}`