Interacting with Minecraft using TCP #3390
-
Minelayer is indeed a commendable library, and I am learning about the TCP protocol through it. I tried to interact with Minecraft's Spigot server by imitating Minelayer's way and content of sending packets, but I encountered an issue. The process of sending the package is as follows: handshake pack
I actually sent a hexadecimal packet like this: login start pack
Same as above Now, there's a problem here login acknowledged
like this But the server gave me feedback on an error:
So can any experienced individuals tell me what problems have arisen. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
You can read https://wiki.vg/Protocol Minecraft expects a specific protocol, you cannot simply take a guess and have it working. |
Beta Was this translation helpful? Give feedback.
-
New progressI noticed that the server sent a packet: OtherI have discovered some related websites again, although there are only a small amount of related content among them |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
No, you cannot set the compression threshold on the client side. The SetCompression packet is used for the server to inform the client to set the compression threshold, not for the client to inform the server. You can read the decompiled Minecraft code to learn more. For example, the SetCompression packet is named So you should add decompression to your program. Decompressing zlib data in Python is not difficult; just However, if you need to log in to your Microsoft account on your Minecraft client, you will also need to encrypt/decrypt data packets. |
Beta Was this translation helpful? Give feedback.
No, you cannot set the compression threshold on the client side. The SetCompression packet is used for the server to inform the client to set the compression threshold, not for the client to inform the server.
You can read the decompiled Minecraft code to learn more. For example, the SetCompression packet is named
LoginCompressionS2CPacket
in the yarn mappings (Mapping table commonly used by Fabric loader), and you can find its usage: When the client receives the packet, the client will call theClientConnection.setCompressionThreshold
method, which sets the compression threshold (or disables compression).So yo…