0

My Post is about Minecraft and its multiplayer servers. I will mention often the information, which is given on this website : https://wiki.vg/Protocol#Login_Start . So, my question is quite a bit complicated I guess. Please take care, that I´m not yet very familiar with Streams. I want to create my own "Chatbot" for Minecraft, which is able to join on every Server without opening the Minecraft launcher. But therefor my programm must receive and send packets.

I know about the protocol, which I mentioned above. In generell, there are 2 big steps of joining on a Server. The first is, to send a handShake and "ping-pong" to make a connection. The second step, probably the most complicated one, is to authenticate my account on this Server. I´m supposed to send certain information to the server and get some information back. Of course, I use DataInput/DataOutputStreams for sending and receiving. Now the protocol above plays a major role, because it says what I have to send to the server and in which form.

Java sending handshake packets to minecraft server

The post above was very usefull for the first step, to create a connection! In fact, somebody has made a lot of effort for this post, so I dont want to copy his code for my post. Please remember, that I used his code in my Project, so every line is the same (And his code works very well!). So, now you know everything about my situation, I ask the question how to send / receive packets with the information required to authenticate my client.

Hopefully you understood what i wanted to ask. Thanks for your time !

Mx1co
  • 9
  • 1
  • 6
  • Does this answer your question? [Cant send minecraft login packet to server?](https://stackoverflow.com/questions/61850007/cant-send-minecraft-login-packet-to-server) – f_puras Nov 27 '20 at 17:51

1 Answers1

0

I'm not sure how much detail you're expecting from me, but all the packets you need to send to the minecraft server & the requests to mojangs authserver are outlined here.

As for the question & code you referenced, that's currently sending a handshake packet with nextstate set to 1 (status) which is only used for pinging the server, not connecting to it. You'll need to set that to 2 (login) & follow the sequenced outlined in the link above instead of just sending a request & ping packets.

Azurethi
  • 68
  • 7