Minecraft - Launching game in Terminal and Command Prompt

Discussion in 'Computer Programming, Emulation, and Game Modding' started by SuperMarioDaBom, Nov 29, 2016.

  1. SuperMarioDaBom
    OP

    SuperMarioDaBom Member

    Newcomer
    49
    12
    Jun 6, 2016
    United States
    I'm very sorry if this is confusing to anyone. Maybe I need to rephrase myself to make it clear.

    I'm making a server manager. In Unity3d. What it will do is download, install, and run these servers. The user chooses what MC version the server will use.

    One of the features that it will have is launching the full game as well as the server. It will launch the version of Minecraft that the server is running. This is to help make the server-making process a little more automated and make it easier for n00bs to play with friends.

    Launching a server from command line is relatively easy. This has already been implemented into my project; what I was missing was launching the game itself.

    Yes; this is how I launch the server, and probably how I am going to launch the game itself as well.

    Unity is C# and Java. It used to support Boo - idk what ever happened to that though.
     
    Joom likes this.


  2. Joom

    Joom  ❤❤❤

    Member
    3,912
    2,631
    Jan 8, 2016
    United States
    Does that mean that Unity projects for consoles come with a built-in interpreter, or are the languages translated upon compilation? Again, sorry for going off-topic, but I'm intrigued now.
     
  3. SuperMarioDaBom
    OP

    SuperMarioDaBom Member

    Newcomer
    49
    12
    Jun 6, 2016
    United States
    Its ok! There's no harm in being intrigued! I honestly don't know. I believe that its the latter, but I could be mistaken.
     
  4. evandixon

    evandixon PMD Researcher

    Member
    1,667
    792
    May 29, 2009
    United States
    It may be worth analyzing how the Curse launcher works. It manages the files and stuff, but when it comes time to run the game, it runs the official launcher instead, so it can handle auth stuff. While I'm sure you'd never do anything sketchy, users would only have to give their MC passwords to the official launcher, possibly making them feel a little better about password theft.
     
  5. SuperMarioDaBom
    OP

    SuperMarioDaBom Member

    Newcomer
    49
    12
    Jun 6, 2016
    United States
    I see what you mean. In a sense, it behaves almost identical to the official launcher when it comes to logging in and such, except for the fact that it doesn't yet save the accessToken to keep the player "signed in". Once its somewhat complete, I can make it open source, if that makes anyone feel better. If anyone manages to get the password from my app, then they can get it the exact same way from the official launcher!
     
  6. SuperMarioDaBom
    OP

    SuperMarioDaBom Member

    Newcomer
    49
    12
    Jun 6, 2016
    United States
    Sorry for the double post! I felt that this should be separated from the message above.

    I appear to also have the command for macOS! Tested it and it worked, see command below:

    /Applications/Minecraft.app/Contents/runtime/jre-x64/1.8.0_74/bin/java -Xdock:icon="/Users/<username>/Library/Application Support/minecraft/assets/objects/99/991b421dfd401f115241601b2b373140a8d78572" -Xdock:name=Minecraft -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="/Users/<username>/Library/Application Support/minecraft/versions/1.8.9/natives" -cp "/Users/<username>/Library/Application Support/minecraft/libraries/com/mojang/netty/1.6/netty-1.6.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/oshi-project/oshi-core/1.1/oshi-core-1.1.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/net/java/dev/jna/platform/3.4.0/platform-3.4.0.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/io/netty/netty-all/4.0.23.Final/netty-all-4.0.23.Final.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/google/guava/guava/17.0/guava-17.0.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/commons-codec/commons-codec/1.9/commons-codec-1.9.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/mojang/authlib/1.5.21/authlib-1.5.21.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/com/mojang/realms/1.7.59/realms-1.7.59.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/lwjgl/lwjgl/lwjgl/2.9.2-nightly-20140822/lwjgl-2.9.2-nightly-20140822.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.2-nightly-20140822/lwjgl_util-2.9.2-nightly-20140822.jar":"/Users/<username>/Library/Application Support/minecraft/libraries/tv/twitch/twitch/6.5/twitch-6.5.jar":"/Users/<username>/Library/Application Support/minecraft/versions/1.8.9/1.8.9.jar" net.minecraft.client.main.Main --username <gamename> --version 1.8.9 --gameDir "/Users/<username>/Library/Application Support/minecraft" --assetsDir "/Users/<username>/Library/Application Support/minecraft/assets" --assetIndex 1.8 --uuid <uuid> --accessToken <accesstoken> --userProperties {} --userType mojang --nativeLauncherVersion 308

    NOTE: This will launch Minecraft version 1.8.9, when the variables are replaced with their proper info. Another thing to note is the -Djava.library.path has been altered; apparently minecraft generates a "natives" folder, with a bunch of numbers in the name of it. It gets deleted when minecraft closes. I believe its generated by the launcher, so it needs to exist in order to run. I copied it while a regular run of Minecraft was running, then specified it in the command above. It works perfectly. Any variables in this are identical to the ones for the windows command.

    Now that I have the two commands, I can begin implementation in my app! Expect a beta soon! :D