quarry icon indicating copy to clipboard operation
quarry copied to clipboard

quarry.net.protocol.ProtocolError: Packet is too long: chat_message

Open hyperpixel34 opened this issue 3 years ago • 3 comments

Hello guys, when I'm trying to use the chat logger example on https://quarry.readthedocs.io/en/latest/examples.html, I always get an quarry.net.protocol.ProtocolError My game version is 1.16.5.

Hope you can help me :)

hyperpixel34 avatar May 10 '21 07:05 hyperpixel34

For new minecraft versions, use a chat message handler like the one in client_messenger.py

def packet_chat_message(self, buff):
    p_text = buff.unpack_chat().to_string()
    p_position = 0
    p_sender = None

    # 1.8.x+
    if self.protocol_version >= 47:
        p_position = buff.unpack('B')

    # 1.16.x+
    if self.protocol_version >= 736:
        p_sender = buff.unpack_uuid()

    if p_position in (0, 1) and p_text.strip():
        self.stdio_protocol.send_line(p_text)

zax2002 avatar May 20 '21 00:05 zax2002

I'm still getting this issue on 1.17.1 using the code specified

Daddy-Talpapa avatar Nov 19 '21 09:11 Daddy-Talpapa

Can you send your code? This should work.

davidawesome02 avatar Jun 08 '22 00:06 davidawesome02