Custom Launcher

Discussion in 'Programming' started by TheWackyTV, Nov 16, 2017.

  1. Hi there.

    I’ve been programming in various programming languages in the past years, and I’ve began to see server develop their own Launcher for Minecraft.

    I was wondering how to do this, I know it’s Java, but where do you start?

    Thanks!
     
  2. MiniDigger

    Supporter

    well, the offical launcher isn't even java anymore.
    generally you use the launcher meta repo to get all the data into the right folders (client jar, assets, libs, natives...), documentation here http://wiki.vg/Game_files
    launcher meta also provides stuff like the log4j config and the arguments you need to start the minecraft jar with.
    (look at the latest version file as an example: https://launchermeta.mojang.com/mc/game/810c48e658dd8e4d94b7b61b3f3f01735caa6bb1/17w46a.json )
    so you just need to make sure that you navigate thru the json files, download all the files into the right folders and then start the client jar with the right arguments.

    and then you need to wrap that into a nice gui, prolly the hardest part :D

    this whole thing is completely independent of the programming language you choose, you can basically use anything that can read json files from the web, download files and start new processes.

    If you get stuck at any point, be sure to ask here, I have gone thru that process already.


    edit: forgot something. if you want your launcher to support online mode (aka requiring ppl to log in using a mojang account, you need to implement auth into the launcher, docs are here http://wiki.vg/Authentication )
     
    • Informative Informative x 2
  3. Thank you so much for the great answer. I’ll get back to the thread if I get stuck :)
     
  4. Sorry, for raising the topic but I have a question - in this URL:
    https://launchermeta.mojang.com/mc/game/810c48e658dd8e4d94b7b61b3f3f01735caa6bb1/17w46a.json
    How to get this string before '17w46a.json' and after 'mc/game'? I thought it was an encryption of version but I don't know what it was encrypted... Or where I can find this long string? Thanks in advance.
     
  5. MiniDigger

    Supporter

  6. Okey, I have reread and it's mentioned:
    "Each resource in the file has a name (the field name of the resource object), a SHA1 hash, and a file size."

    Can you explain me what SHA1 hash? Where can I get it? If I want download another version where I can get this hash?
     
  7. MiniDigger

    Supporter

    The hash is to verify the integrity of the downloaded file so that you know that it didn't corrupt and nobody changed the file to something malicious while you downloaded it. All files linked in the launcher meta have a hash next to the URL, just look at the jsons.