Skip to content

Instantly share code, notes, and snippets.

@BoQsc
Last active March 17, 2021 10:07
Show Gist options
  • Save BoQsc/046d808b7c8dc82de65119a4329868f2 to your computer and use it in GitHub Desktop.
Save BoQsc/046d808b7c8dc82de65119a4329868f2 to your computer and use it in GitHub Desktop.
This script will launch newly downloaded Minecraft Java Edition that is 1.14.3 version
@echo off
title Minecraft Launcher
:: main directory of the game
set "MC_DIR=%APPDATA%\.minecraft"
:: Is stored here...
:: saves/, resourcepacks/ and screenshots/ dirs
:: and options.txt and servers.dat files
set "GAME_DIR=%MC_DIR%\profile"
:: libraries and resource dir (requires no changes)
set "ASSETS_DIR=%MC_DIR%\assets"
set "ASSETS_INDEX=1.14"
:: version minecraft (from versions/ dir)
set "VERSION=1.14.3"
:: get archive from natives/ dir
set "NATIVES_DIR=%MC_DIR%\versions\%VERSION%\%VERSION%-natives"
FOR /D %%i in ("%NATIVES_DIR%*") DO set "Natives_DIR=%%i"
:: player nickname (the over head)
set "PLAYER=Vaidas"
:: resolution
set "WIDTH=800"
set "HEIGHT=640"
:: running minecraft
%SystemDrive%
cd %MC_DIR%
java.exe -Xmx1G -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -Xmn128M -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ^
-cp ^
%MC_DIR%\libraries\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;^
%MC_DIR%\libraries\com\google\guava\guava\21.0\guava-21.0.jar;^
%MC_DIR%\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;^
%MC_DIR%\libraries\com\mojang\authlib\1.5.25\authlib-1.5.25.jar;^
%MC_DIR%\libraries\com\mojang\brigadier\1.0.17\brigadier-1.0.17.jar;^
%MC_DIR%\libraries\com\mojang\datafixerupper\2.0.24\datafixerupper-2.0.24.jar;^
%MC_DIR%\libraries\com\mojang\javabridge\1.0.22\javabridge-1.0.22.jar;^
%MC_DIR%\libraries\com\mojang\patchy\1.1\patchy-1.1.jar;^
%MC_DIR%\libraries\com\mojang\realms\1.14.17\realms-1.14.17.jar;^
%MC_DIR%\libraries\com\mojang\text2speech\1.11.3\text2speech-1.11.3-natives-windows.jar;^
%MC_DIR%\libraries\com\mojang\text2speech\1.11.3\text2speech-1.11.3.jar;^
%MC_DIR%\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;^
%MC_DIR%\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar;^
%MC_DIR%\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;^
%MC_DIR%\libraries\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;^
%MC_DIR%\libraries\it\unimi\dsi\fastutil\8.2.1\fastutil-8.2.1.jar;^
%MC_DIR%\libraries\net\java\dev\jna\jna\4.4.0\jna-4.4.0.jar;^
%MC_DIR%\libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;^
%MC_DIR%\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;^
%MC_DIR%\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;^
%MC_DIR%\libraries\net\sf\jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar;^
%MC_DIR%\libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;^
%MC_DIR%\libraries\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;^
%MC_DIR%\libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;^
%MC_DIR%\libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;^
%MC_DIR%\libraries\org\apache\logging\log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar;^
%MC_DIR%\libraries\org\apache\logging\log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl\3.2.2\lwjgl-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl\3.2.2\lwjgl-3.2.2.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-glfw\3.2.2\lwjgl-glfw-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-glfw\3.2.2\lwjgl-glfw-3.2.2.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-jemalloc\3.2.2\lwjgl-jemalloc-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-jemalloc\3.2.2\lwjgl-jemalloc-3.2.2.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-openal\3.2.2\lwjgl-openal-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-openal\3.2.2\lwjgl-openal-3.2.2.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-opengl\3.2.2\lwjgl-opengl-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-opengl\3.2.2\lwjgl-opengl-3.2.2.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-stb\3.2.2\lwjgl-stb-3.2.2-natives-windows.jar;^
%MC_DIR%\libraries\org\lwjgl\lwjgl-stb\3.2.2\lwjgl-stb-3.2.2.jar;^
%MC_DIR%\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar;^
%MC_DIR%\versions\%VERSION%\%VERSION%.jar ^
net.minecraft.client.main.Main --username %PLAYER% --version %VERSION% --accessToken 0 --userProperties {} --gameDir %GAME_DIR% --assetsDir %ASSETS_DIR% --assetIndex %ASSETS_INDEX% --width %WIDTH% --height %HEIGHT%
pause
@echo off
:: Supports only single version installed.
:: Remove the files and folders in libraries folder | If you are changing version. | Or Updating.
:: %APPDATA%\.minecraft\libraries
title Minecraft Launcher
:: main directory of the game
set "MC_DIR=%APPDATA%\.minecraft"
:: Is stored here...
:: saves/, resourcepacks/ and screenshots/ dirs
:: and options.txt and servers.dat files
set "GAME_DIR=%MC_DIR%\profile"
:: libraries and resource dir (requires no changes)
set "ASSETS_DIR=%MC_DIR%\assets"
:: version minecraft (from versions/ dir)
cd %MC_DIR%/versions
for /R %%f in (*.jar) do SET "VERSION=%%~nf"
set "ASSETS_INDEX=%VERSION:~0,-2%"
:: get archive from natives/ dir
set "NATIVES_DIR=%MC_DIR%\versions\%VERSION%\%VERSION%-natives"
FOR /D %%i in ("%NATIVES_DIR%*") DO set "Natives_DIR=%%i"
:: player nickname (the over head)
set "PLAYER=Vaidas"
:: resolution
set "WIDTH=800"
set "HEIGHT=640"
:: running minecraft
:: change directory to System Drive
%SystemDrive%
:: scan names of the libraries
cd "%MC_DIR%/libraries"
for /R %%a in (*.jar) do (
call set "libraries=%%libraries%%%%a;"
)
cd %MC_DIR%
SET "PATH=%PATH%;C:\Program Files (x86)\Minecraft Launcher\runtime\jre-x64\bin\"
java.exe -Xmx1G -XX:-UseAdaptiveSizePolicy -Xmn128M -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ^
-cp %libraries%^
%MC_DIR%\versions\%VERSION%\%VERSION%.jar ^
net.minecraft.client.main.Main --username %PLAYER% --version %VERSION% --accessToken 0 --userProperties {} --gameDir %GAME_DIR% --assetsDir %ASSETS_DIR% --assetIndex %ASSETS_INDEX% --width %WIDTH% --height %HEIGHT%
pause
REM The new Minecraft versions like 1.65.5 sometimes gives, this is old version, the new version has this option removed and works perfectly.
REM Unrecognized VM option 'UseConcMarkSweepGC'
REM Error: Could not create the Java Virtual Machine.
REM Error: A fatal exception has occurred. Program will exit.
@echo off
:: Supports only single version installed.
:: Remove the files and folders in libraries folder | If you are changing version. | Or Updating.
:: %APPDATA%\.minecraft\libraries
title Minecraft Launcher
:: main directory of the game
set "MC_DIR=%APPDATA%\.minecraft"
:: Is stored here...
:: saves/, resourcepacks/ and screenshots/ dirs
:: and options.txt and servers.dat files
set "GAME_DIR=%MC_DIR%\profile"
:: libraries and resource dir (requires no changes)
set "ASSETS_DIR=%MC_DIR%\assets"
:: version minecraft (from versions/ dir)
cd %MC_DIR%/versions
for /R %%f in (*.jar) do SET "VERSION=%%~nf"
set "ASSETS_INDEX=%VERSION:~0,-2%"
:: get archive from natives/ dir
set "NATIVES_DIR=%MC_DIR%\versions\%VERSION%\%VERSION%-natives"
FOR /D %%i in ("%NATIVES_DIR%*") DO set "Natives_DIR=%%i"
:: player nickname (the over head)
set "PLAYER=Vaidas"
:: resolution
set "WIDTH=800"
set "HEIGHT=640"
:: running minecraft
:: change directory to System Drive
%SystemDrive%
:: scan names of the libraries
cd "%MC_DIR%/libraries"
for /R %%a in (*.jar) do (
call set "libraries=%%libraries%%%%a;"
)
cd %MC_DIR%
SET "PATH=%PATH%;C:\Program Files (x86)\Minecraft Launcher\runtime\jre-x64\bin\"
java.exe -Xmx1G -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -Xmn128M -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ^
-cp %libraries%^
%MC_DIR%\versions\%VERSION%\%VERSION%.jar ^
net.minecraft.client.main.Main --username %PLAYER% --version %VERSION% --accessToken 0 --userProperties {} --gameDir %GAME_DIR% --assetsDir %ASSETS_DIR% --assetIndex %ASSETS_INDEX% --width %WIDTH% --height %HEIGHT%
pause
@BoQsc
Copy link
Author

BoQsc commented Dec 23, 2020

@echo off
:: Supports only single version installed.
:: Remove the files and folders in libraries folder | If you are changing version. | Or Updating.
:: %appdata%\Roaming\.minecraft\libraries

title Minecraft Launcher

:: main directory of the game
set "MC_DIR=%APPDATA%\.minecraft"

:: Is stored here...
:: saves/, resourcepacks/ and screenshots/ dirs
:: and options.txt and servers.dat files
set "GAME_DIR=%MC_DIR%\profile"

:: libraries and resource dir (requires no changes)
set "ASSETS_DIR=%MC_DIR%\assets"

set "ASSETS_INDEX=1.16"

:: version minecraft (from versions/ dir)
set "VERSION=1.16.4"

:: get archive from natives/ dir
set "NATIVES_DIR=%MC_DIR%\versions\%VERSION%\%VERSION%-natives"
FOR /D %%i in ("%NATIVES_DIR%*") DO set "Natives_DIR=%%i"

:: player nickname (the over head)
set "PLAYER=Vaidas"

:: resolution
set "WIDTH=800"
set "HEIGHT=640"

:: running minecraft

:: change directory to System Drive
%SystemDrive%

:: scan names of the libraries
cd "%MC_DIR%/libraries"
for /R %%a in (*.jar) do (
call set "libraries=%%libraries%%%%a;"

)


cd %MC_DIR%
SET "PATH=%PATH%;C:\Program Files (x86)\Minecraft Launcher\runtime\jre-x64\bin\"
java.exe -Xmx1G -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -Xmn128M -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ^
-cp %libraries%^
%MC_DIR%\versions\%VERSION%\%VERSION%.jar ^
net.minecraft.client.main.Main --username %PLAYER% --version %VERSION% --accessToken 0 --userProperties {} --gameDir %GAME_DIR% --assetsDir %ASSETS_DIR% --assetIndex %ASSETS_INDEX% --width %WIDTH% --height %HEIGHT%

pause




@BoQsc
Copy link
Author

BoQsc commented Dec 23, 2020

When going from latest version to older version. There is no error with libraries.
However, when going from older version to latest version. This is the error you'll see.
Remove everything in the %appdata%\Roaming\.minecraft\libraries and redownload the minecraft version, to fix it for now.

Exception in thread "main" java.lang.NoSuchMethodError: com.mojang.serialization.codecs.RecordCodecBuilder$Instance.group(Lcom/mojang/datafixers/kinds/App;Lcom/mojang/datafixers/kinds/App;Lcom/mojang/datafixers/kinds/App;Lcom/mojang/datafixers/kinds/App;)Lcom/mojang/datafixers/Products$P4;
        at hd.a(SourceFile:16)
        at hd$$Lambda$259/1985869725.apply(Unknown Source)
        at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72)
        at hd.<clinit>(SourceFile:16)
        at hh.<clinit>(SourceFile:23)
        at bup.<clinit>(SourceFile:240)
        at ctt.<clinit>(SourceFile:13)
        at kp.<clinit>(SourceFile:11)
        at hk.g(SourceFile:44)
        at hk$$Lambda$123/1514476350.get(Unknown Source)
        at hk.a(SourceFile:75)
        at hk$$Lambda$131/445918232.accept(Unknown Source)
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:676)
        at hk.<clinit>(SourceFile:74)
        at gm.<clinit>(SourceFile:237)
        at vm.a(SourceFile:42)
        at net.minecraft.client.main.Main.main(SourceFile:137)
Press any key to continue . . .

@BoQsc
Copy link
Author

BoQsc commented Dec 23, 2020

For debuging and testing of libraries scan:

@echo off    
set "MC_DIR=%APPDATA%\.minecraft"
cd %MC_DIR%/libraries
for /R %%f in (*.jar) do echo %%f;^^
pause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment