Using packet 250 outside of a Minecraft client

Discussion in 'Plugin Development' started by Alec Gorge, Aug 2, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Alec Gorge

    Is it possible to have a 3rd party, non-Minecraft client connect on 25565 and take advantage of the custom packet 250 for communication with plugins? If so, what packets are required to get to that point? Is there any way to get around having to send a login packet? Is there any 3rd party implementation of at least part of the Minecraft clientside protocol?

    I would love this because then people wouldn't have to fiddle with forwarding ports for my plugins as long as they already had a server up and running.

    Any pointers in any language are appreciated.

    Does anyone have any pointers?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  2. This page (especially the Protocol specification) is a good starting point when going in the direction of custom client programming.

    Regarding your questions: You could - in theory - create a copy of some of the required classes of the net.minecraft package to make your application's communication a bit less work for you. You probably won't be allowed to distribute them then, though, or something like that, dunno.

    Anyway, it's not REQUIRED to take the pre-built ones. You can just write and read raw data from streams (information seen on the Protocol page). The problematic part is, that in order to be able to fully communicate with the server, you basically need to be able to parse EVERY packet you get. Packets don't include information about their size, you need to know by yourself how big the packet you just got actually is, otherwise it will run out of sync and nothing will work.

    I don't know what exactly you want to use the protocol for, but it might be possible to just use the client minecraft.jar as a classpath and load the Packet classes from there.

    You wanted a pointer, the page is one ;)
     
  3. Offline

    joshua katz

    A good pointer is spout or BukkitContrib
     
  4. Offline

    md_5

    http://mc.wiki.vg/
    Is the preferred pointer.

    But basically you need to implement though whole protocol, so you can actually get to when the server sends you these packets.
    There aren't any public 1.3 protocol implementations for Java yet (I do have a private one :p), so if you were lazy the way to go would be to use the Minecraft server, but that would render you unable to distribute your program.

    Once you have implemented the protocol (easiest way is DataInputStreams) you should have enough knowledge to implement that short sized byte array as required by Packet250.
     
  5. Out of curiousity, where exactly is the difference between both pages? I've seen links to both, and they appear to have similar contents. Is it that the project moved somewhere else? Both domains appear to be maintained (they are both updated to 1.3.1 for example).

    (btw for me only "wiki.vg" works, "mc.wiki.vg" gives a DNS error)
     
  6. Offline

    Alec Gorge

    Thanks for the links to the wiki, but I had already poured over those, and it didn't help me.

    So, as long as I implement most of the Minecraft protocol, I won't have to login as a player to use packet 250 to communicate with my plugin? I don't want to write my own custom Minecraft client, I just want to communicate with my plugin over port 25565.

    I think I am going to look through the MC server see what checks have to be passed for the server to read packet 250.
     
  7. Offline

    md_5

    http://wiki.vg/ is the actual name of the wiki and what we prefer to use for the mcdevs project.
    http://mc.kev009.com/ is just the raw name of the server which it is hosted on, never really intended to be public facing.

    Yes they are the same pages identically, but the above is more 'professional' if you will. </nitpick>
    You need to have a player logged in and sending keepalives to do anything with the server streams.
    No two ways about it.
     
  8. Offline

    Alec Gorge

    Ah. That is the answer I was looking for, thanks. Unfortunate. I guess my users will have to continue forwarding ports...
     
Thread Status:
Not open for further replies.

Share This Page