barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
534 stars 74 forks source link

How do I unpack packets with arrays in them? #146

Closed Lilyp3892 closed 2 years ago

Lilyp3892 commented 2 years ago

Hi, I am trying to unpack downstream_entity_equipment which uses an array: https://wiki.vg/Protocol#Entity_Equipment I am trying to use Struct to unpack It but I am struggling. Here is some code using Struct to unpack upstream_player_look: xXkAg_OhTlGoOFGgLZL7pg this makes it readable instead of just hex code. I am trying to do a similar thing, but with downstream_entity_equipment: Screenshot_5

you can see where I am having trouble, trying to use https://docs.python.org/3/library/struct.html#format-characters

I am new to packet handling and would love some help understanding it better

that top image is coded from https://github.com/LiveOverflow/minecraft-hacked/blob/main/01_protocol_proxy/teleport_proxy.py

If anyone can help me out it would be greatly appreciated! <3