ProtocolLib

3M Downloads

EncoderException when sending packet

IM-IgniteDEV opened this issue ยท 3 comments

commented

Describe the question
Alright, so i use ProtocolLIB + PacketWrapper and when I send a packet to player it kick him with error " Internal Exception: Io.netty.handler.codec.EncoderException: java.lang.NullPointerException",
in the console all i can see is
[17:30:17 ERROR]: java.lang.NullPointerException
[17:30:17 INFO]: IgniteDEV lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException

Version of minecraft: 1.13.2

Expected behavior
I want to send metadata with item to itemframe.

Code
image

commented

Yea, but how can i do that if the Serializer is not going to take it?

commented

image

I had code like that before, but this is old screen, i change serializer to Integer and made another Serializer for Itemstack and i got exception about unknown datatype for serializer.

commented

You're going to want to use the data watcher registry along with a data watcher object. The item stack will also probably have to be wrapped in an optional (I forget exactly when they made that change, it might have been 1.13)