Minecraft Launcher Login Code closed

From Wifi Adapters DB
Jump to: navigation, search

Want to improve this question? Update the question so it's on-topic for Stack Overflow.



Closed 9 years ago.



I don't know if this is the correct website to ask this (I also asked in the forums), but I created a Minecraft launcher from scratch (not with Java). minecraft Everything works and I can launch Minecraft, but it starts in offline-mode everytime. I used a batch-code to start the minecraft.jar in the .minecraft-Folder. Although I know there is a way for Minecraft to launch with parameters using the Minecraft Launcher, I cannot change the Minecraft-Directory (from.minecraft to.minecraft2). Is there any way to connect to Minecraft.net and to login and launch Minecraft using batch or Visual Basic? Thank you so much!



1 Answer 1



You can change the location Minecraft will look for its data folder by setting the APPDATA environment variable before running the launcher. You can do this with a batch script like this:



Remember, Minecraft.exe is secretly just a wrapped jar file, and its purpose in life as an EXE is to run itself with java.



You can pass arguments to it to select a username and password by changing the second line to something like this:



Or, if you really feel like it, you can obtain your very own session key by querying the login API directly, parsing your session ID and exact username from it, and launching minecraft directly (bypassing the launcher) with:



You can specify absolute paths for the minecraft jars, and if you do not, they must be relative to the working directory. To specify a relative path for the natives directory, use something like .\This\Folder\Relative\To\Working\Dir



Frankly I don't see why you're bothering. Just use magic launcher or something.



Thank you so much! I used the third script, but it always launched in offline-mode. I want to create my own launcher, that's why I don't use Magic Launcher. But how does Magic Launcher do that that it sais "Account migrated" or something like this? What does [sessionID] stand for? Password? Where do I have to put it? Thank you for your answer! - DigitalClark Oct 15, 2012 at 21:52



Yay! Thanks! I got it! Thank you so much! - DigitalClark Oct 15, 2012 at 21:59



I think that before you keep programming too much, you should learn a bit more about how file paths are treated, and the intricacies of absolute and relative paths. Also, click on the login link in the post (which tries to login to your username with a made up password) and it will become fairly evident immediately how magic launcher knows that you need to login with your email address. - Wug Oct 16, 2012 at 3:51



Well, I did it now. It works perfectly, I can log in and I can launch Minecraft. I know how that worked, but I didn't know about session IDs. Minecraft online Not it works. Thanks. - DigitalClark Oct 16, 2012 at 9:51



Not the answer you're looking for? Browse other questions tagged java visual-studio login batch-file minecraft or ask your own question.