Minecraft - Launching game in Terminal and Command Prompt

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
I've been working on a Minecraft server manager application in Unity3d (Yes, its in a game engine. I did that so that making it multi-platform would be extremely simple, and I am very familiar with the Unity api). I am implementing a function to launch Minecraft in-app, bypassing the official Minecraft launcher.

I already implemented the Minecraft authentication api, so getting the access token is already handled. The one thing that is frustrating me is that I cannot get Minecraft to launch from terminal. Once that gets done, implementation into Unity will be a piece of cake.

That being said, can someone give me the terminal command that will launch it? Obviously with the necessary place-holders. Thanks in advance. This has been frustrating me to no end, and Google doesn't seem to wanna help. All I could find were the old pre-yggdrasil commands.

Thanks again.
 
  • Like
Reactions: acro42

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
Is there anyone that can help? I feel kinda bad for bumping my own thread, but its been since November and not one single reply has been made. :mellow:
 

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
java - jar minecraft.jar

Of course, other parameters for Java can be passed, but this is the most basic way of loading it. Unless of course this doesn't work anymore. I haven't played the game in well over a year.
 
Last edited by Joom,

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
java - jar minecraft.jar

Of course, other parameters for Java can be passed, but this is the most basic way of loading it. Unless of course this doesn't work anymore. I haven't played the game in well over a year.

That's the base of it, but it requires a whole ton of arguments to launch. Some of these are the Access Code, libraries, etc.

Apparently the command is EXTREMELY long. I tried getting it from Minecraft's code, but it only gives "half" of it, which already is really long. When typing that half command in, it gives an error that it can't find a library - probably because it is not implemented into the code.
 

evandixon

PMD Researcher
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
If you're using Windows 8 or above, you can launch Minecraft, then use Task Manager to display all the command-line arguments Java was run with. It should be a simple matter to mimic that afterward.
k5uTXEv.png
 
  • Like
Reactions: Deleted User

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
Ok, I appear to have found something useful! I used ProcessExplorer, as Task Manager wasn't giving the command in its entirety due to how long it is. Here it is:

"C:\Program Files (x86)\Minecraft\runtime\jre-x64\1.8.0_25\bin\javaw.exe" -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M "-Dos.name=Windows 10" -Dos.version=10.0 "-Djava.library.path=C:\Users\<username>\AppData\Roaming\.minecraft\versions\1.8.9\1.8.9-natives-34757015043807" -cp "C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\mojang\netty\1.6\netty-1.6.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\net\java\dev\jna\jna\3.4.0\jna-3.4.0.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\net\sf\jopt-simple\jopt-simple\4.6\jopt-simple-4.6.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\google\guava\guava\17.0\guava-17.0.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\mojang\authlib\1.5.21\authlib-1.5.21.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\com\mojang\realms\1.7.59\realms-1.7.59.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar;C:\Users\<username>\AppData\Roaming\.minecraft\libraries\tv\twitch\twitch\6.5\twitch-6.5.jar;C:\Users\<username>\AppData\Roaming\.minecraft\versions\1.8.9\1.8.9.jar" net.minecraft.client.main.Main --username <gameuser> --version 1.8.9 --gameDir "C:\Users\<username>\AppData\Roaming\.minecraft" --assetsDir "C:\Users\<username>\AppData\Roaming\.minecraft\assets" --assetIndex 1.8 --uuid <uuid> --accessToken <accesstoken> --userProperties {} --userType legacy --nativeLauncherVersion 307

Please note: <username> is your home folder. <gameuser> is your Minecraft username. <uuid> is your player's uuid. <accesstoken> is the accessToken (must be valid, otherwise will not work). This also is specific to Win10 I believe, so it might require editing for different versions. It is set to 1.8.9, but as seen above this can be pretty easily changed.

I will soon be porting this to macOS and other Windows versions! Thanks @UniqueGeek for the lead! :D

This was tested on Win10. It works perfectly just as long as the accessToken is valid! :P
 

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
Why is all of that necessary? Shouldn't invoking the main JAR do all of that? I also noticed that it's using fixed memory allocations, which won't be ideal for all users.
 
  • Like
Reactions: Deleted User
D

Deleted User

Guest
If you're using Windows 8 or above, you can launch Minecraft, then use Task Manager to display all the command-line arguments Java was run with. It should be a simple matter to mimic that afterward.
k5uTXEv.png
What? How do you get this?

And you are making a server manager? For Minecraft, with Unity? Maybe you could make a GUi for this in the future so you won't have to deal with command line
 

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
Why is all of that necessary? Shouldn't invoking the main JAR do all of that? I also noticed that it's using fixed memory allocations, which won't be ideal for all users.

It is necessary, in order for Minecraft to have access to all of the libraries and things that it needs. Also yes, it uses fixed memory allocations. Though it is customizable in the Minecraft Launcher.

And you are making a server manager? For Minecraft, with Unity? Maybe you could make a GUi for this in the future so you won't have to deal with command line

GUI for what? I don't understand what you mean.
 
D

Deleted User

Guest
It is necessary, in order for Minecraft to have access to all of the libraries and things that it needs. Also yes, it uses fixed memory allocations. Though it is customizable in the Minecraft Launcher.



GUI for what? I don't understand what you mean.
GUI for the server manager.....

oh forget it
 
D

Deleted User

Guest
It is necessary, in order for Minecraft to have access to all of the libraries and things that it needs. Also yes, it uses fixed memory allocations. Though it is customizable in the Minecraft Launcher.



GUI for what? I don't understand what you mean.
He's referring to something such as Multicraft or mcmyadmin. They are full guis(big shiny clicky buttons) that do most tasks, instead of using terminal

EDIT: For example here is the one that I use everyday for work. Do I get bonus points for the fancy editing?

JtA9IN1.png
 
Last edited by ,
  • Like
Reactions: Deleted User

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
It is necessary, in order for Minecraft to have access to all of the libraries and things that it needs. Also yes, it uses fixed memory allocations. Though it is customizable in the Minecraft Launcher.
When did this happen, or is it only pertinent for your manager to work? I used to invoke the JAR with a Bash script that was just a single line with memory allocations for my system. Maybe it's different on Windows. I don't really know. It'd be interesting to test your MacOS build when it's done.
 
Last edited by Joom,

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
GUI for the server manager.....

oh forget it

He's referring to something such as Multicraft or mcmyadmin. They are full guis(big shiny clicky buttons) that do most tasks, instead of using terminal

EDIT: For example here is the one that I use everyday for work. Do I get bonus points for the fancy editing?

JtA9IN1.png

Ah, I see where that may have been confusing. The app I'm making will download and create the server for the specified version, then launch the corresponding version of Minecraft itself. It achieves this by authenticating through yggdrasil - Mojang's authentication servers. I hope this clears up any confusion.

Lol 10/10 for best edits ever :P

When did this happen, or is it only pertinent for your manager to work? I used to invoke the JAR with a Bash script that was just a single line with memory allocations for my system. Maybe it's different on Windows. I don't really know. It'd be interesting to test your MacOS build when it's done.

Its been that way ever since Minecraft switched launchers, I believe (2013?). I have only been playing Minecraft since its 1.8 release, so I'm not too well informed on how it worked before then. Don't expect anything very soon, though. I'm fairly busy irl and also tend to procrastinate on things. :P Since I now know someone wants a release, I shall put this towards the top of my priorities. :D
 
Last edited by SuperMarioDaBom,

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
Its been that way ever since Minecraft switched launchers, I believe (2013?). I have only been playing Minecraft since its 1.8 release, so I'm not too well informed on how it worked before then. Don't expect anything very soon, though. I'm fairly busy irl and also tend to procrastinate on things. :P Since I now know someone wants a release, I shall put this towards the top of my priorities. :D
Ah, ok. I haven't really played since 1.5.2 or so, so that makes sense. Now I kinda want to try the latest build and see if I can figure out a simpler way to launch it. Honestly, it seems rather regressive to make that wall of text necessary, but I'm not a game developer, so what do I know?
 

SuperMarioDaBom

Well-Known Member
OP
Newcomer
Joined
Jun 6, 2016
Messages
61
Trophies
0
XP
120
Country
United States
Ah, ok. I haven't really played since 1.5.2 or so, so that makes sense. Now I kinda want to try the latest build and see if I can figure out a simpler way to launch it. Honestly, it seems rather regressive to make that wall of text necessary, but I'm not a game developer, so what do I know?

I don't think there is any easier way to launch it from command line, unfortunately. It needs all that info to launch. I think it also protects from piracy, so that it becomes a whole lot harder to implement ALL of those libraries, plus a valid accessToken. The harder it is, the less likely someone is gonna try and circumvent it.
 

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
I don't think there is any easier way to launch it from command line, unfortunately. It needs all that info to launch. I think it also protects from piracy, so that it becomes a whole lot harder to implement ALL of those libraries, plus a valid accessToken. The harder it is, the less likely someone is gonna try and circumvent it.
I suppose. I know of quite a few cracked launchers floating around that support the latest build, and this is due to the nature of Minecraft (which hasn't changed in the licensing department for quite a while). If they'd implement hardware ID licensing (say the ID of your hard drive or processor licenses the software) then it'd be much harder to crack, and wouldn't require legitimate customers and community developers to go through all these arduous tasks just to launch the game. But meh, I'm getting off-topic. I'll keep up for that Mac build and see if I can help in any way once it's done.
 

evandixon

PMD Researcher
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
Wait, you're making a server manager? You shouldn't need to deal with access tokens for servers.

For a server, it should just be:
Code:
java -jar {minecraft server jar} -server -Xms{min memory}M -Xmx{max memory}M nogui
 
  • Like
Reactions: Joom

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,067
Trophies
1
Location
US
Website
mogbox.net
XP
6,077
Country
United States
Wait, you're making a server manager? You shouldn't need to deal with access tokens for servers.

For a server, it should just be:
Code:
java -jar {minecraft server jar} -server -Xms{min memory}M -Xmx{max memory}M nogui
See, that's what I was thinking. I wonder if Unity is what's giving OP problems, but I really don't know much about this.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: Welcome!