Sunday 1 September 2019

java - How to launch minecraft 1.7.2 from Terminal / Command Line


I've been playing with the new Yggdrasil authserver that mojang created and I have been learning how to get authentication keys etc. Now I want to know how I can launch minecraft from terminal (UBUNTU) (1.7.2). I've looked everywhere on stackoverflow and google and can only find stuff for the old methods.


The old code such as:


java -cp ".minecraft/bin/*" -Djava.library.path=".minecraft/bin/natives/" net.minecraft.client.Minecraft "username" "login id"

no longer works with the updates around 1.7.2 Any ideas?



Answer



Here is the method I used that works (only tested on Windows XP):



@echo off
cd\
set MCDIR=%APPDATA%\.minecraft
cd %MCDIR%
java -Xmx512M -Djava.library.path="%MCDIR%\versions\1.7.2\1.7.2-natives" -cp "%MCDIR%\libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;%MCDIR%\libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;%MCDIR%\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;%MCDIR%\libraries\com\mojang\authlib\1.3\authlib-1.3.jar;%MCDIR%\libraries\io\netty\netty-all\4.0.10.Final\netty-all-4.0.10.Final.jar;%MCDIR%\libraries\java3d\vecmath\1.3.1\vecmath-1.3.1.jar;%MCDIR%\libraries\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar;%MCDIR%\libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;%MCDIR%\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;%MCDIR%\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;%MCDIR%\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;%MCDIR%\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;%MCDIR%\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;%MCDIR%\libraries\com\google\guava\guava\15.0\guava-15.0.jar;%MCDIR%\libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;%MCDIR%\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;%MCDIR%\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;%MCDIR%\libraries\net\java\jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar;%MCDIR%\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;%MCDIR%\libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;%MCDIR%\libraries\org\lwjgl\lwjgl\lwjgl\2.9.0\lwjgl-2.9.0.jar;%MCDIR%\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.0\lwjgl_util-2.9.0.jar;%MCDIR%\versions\1.7.2\1.7.2.jar" net.minecraft.client.main.Main --username [player name] --version 1.7.2 --gameDir C:\DOCUME~1\[USER]\APPLIC~1\MINECR~1 --assetsDir C:\DOCUME~1\[USER]\APPLIC~1\MINECR~1\assets --accessToken [obtain from launcher_profiles.json in MC directory] --uuid (Default)



Before this will work, you MUST run Minecraft and open the folder "versions\1.7.2\1.7.2-natives-xxxx", where xxxx is a random number and copy the contents to a new folder called "1.7.2-natives" or without the numbers.


Note: Change [USER] to your user account in Windows. If your user account is >8 characters, you have to stop at 6 characters and put the "~1" on the end (MS-DOS format). [player name] can just be like Player or any name you wish. The launcher_profiles.json file (in main MC folder) is where you obtain the access token that you put in here.


Save using notepad as minecraft.bat


You can create a VBS file so this batch runs without a command prompt window (looks nicer). To do this, create a VBS file (minecraft.vbs) using notepad, edit and add this code:



Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c minecraft.bat"
oShell.Run strArgs, 0, false



Create a shortcut using (minecraft.vbs) and you are all set!


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...