3

In the past I have been able to launch Minecraft 1.6 from the command-line, bypassing the launcher, and everything worked great. With Minecraft 1.7.4 I can get almost all the way there, but I don't have any sound in-game. Instead, I see Unable to play unknown soundEvent errors in the trace.

Starting Minecraft from the launcher works fine, sound and all. This is on Windows 7 64-bit.

Here's the command-line I am using (username/session removed):

cd \Users\RLUser\AppData\Roaming\.minecraft

"C:\Program Files\Java\jre6\bin\java.exe" -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -Djava.library.path=C:\Users\RLUser\AppData\Roaming\.minecraft\versions\1.7.4\snapshot -cp C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\java3d\vecmath\1.3.1\vecmath-1.3.1.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\io\netty\netty-all\4.0.10.Final\netty-all-4.0.10.Final.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\google\guava\guava\15.0\guava-15.0.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\com\mojang\authlib\1.2\authlib-1.2.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl\2.9.1-nightly-20131120\lwjgl-2.9.1-nightly-20131120.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.1-nightly-20131120\lwjgl_util-2.9.1-nightly-20131120.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\libraries\tv\twitch\twitch\5.12\twitch-5.12.jar;C:\Users\RLUser\AppData\Roaming\.minecraft\versions\1.7.4\1.7.4.jar net.minecraft.client.main.Main --username myusername --accessToken myaccesstoken --userProperties {} --version 1.7.4 --gameDir C:\Users\RLUser\AppData\Roaming\.minecraft --assetsDir C:\Users\RLUser\AppData\Roaming\.minecraft\assets

Here's the console trace with the sound errors:

C:\Users\RLUser\bin>cd \Users\RLUser\AppData\Roaming\.minecraft 
[20:41:30] [main/INFO]: Setting user: myusername
[20:41:30] [main/INFO]: (Session ID is token:myaccesstoken:myusername)
[20:41:30] [Client thread/INFO]: LWJGL Version: 2.9.1
[20:41:30] [Client thread/INFO]: Reloading ResourceManager: Default

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.
[20:41:31] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[20:41:31] [Sound Library Loader/INFO]: Sound engine started
[20:41:31] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[20:41:31] [MCO Availability Checker #1/ERROR]: Couldn't connect to Realms
[20:41:36] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu
[20:41:37] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:gui.button.press
[20:41:38] [Server thread/INFO]: Starting integrated minecraft server version 1.7.4
[20:41:38] [Server thread/INFO]: Generating keypair
[20:41:39] [Server thread/INFO]: Preparing start region for level 0
[20:41:39] [Server thread/INFO]: Changing view distance to 12, from 10
[20:41:39] [Server thread/INFO]: myusername[local:E:2d9f08ca] logged in with entity id 322 at (-206.89310612784573, 63.0, -122.53532329598148)
[20:41:39] [Server thread/INFO]: myusername joined the game
[20:41:39] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:gui.button.press
[20:41:43] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:step.stone
[20:41:44] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:step.stone
[20:41:45] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:step.stone
[20:41:46] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:step.stone
[20:41:47] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:liquid.water
[20:41:47] [Server thread/INFO]: Saving and pausing game...
[20:41:47] [Server thread/INFO]: Saving chunks for level 'My World'/Overworld
[20:41:47] [Server thread/INFO]: Saving chunks for level 'My World'/Nether
[20:41:47] [Server thread/INFO]: Saving chunks for level 'My World'/The End
[20:41:48] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:gui.button.press
[20:41:48] [Server thread/INFO]: Stopping server
[20:41:48] [Server thread/INFO]: Saving players
[20:41:48] [Server thread/INFO]: Saving worlds
[20:41:48] [Server thread/INFO]: Saving chunks for level 'My World'/Overworld
[20:41:48] [Server thread/INFO]: Saving chunks for level 'My World'/Nether
[20:41:48] [Server thread/INFO]: Saving chunks for level 'My World'/The End
[20:41:48] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu
[20:41:49] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:gui.button.press
[20:41:49] [Client thread/INFO]: Stopping!

SoundSystem shutting down...
    Author: Paul Lamb, www.paulscode.com

I know that Minecraft 1.7 uses a new assets folder structure so I tried a number of things, including copying the sound/sounds folders from the older folder structure as well as creating an assets/virtual/legacy folder with the old assets under there. No change in behaviour though.

Is there some magic command-line sauce for 1.7.4 that will allow me to start the game with sound?

3 Answers 3

6

Solved! I was missing a single parameter in my command-line:

--assetIndex 1.7.4

The launcher does show you most of the command-line it uses to start Minecraft but not all. To see the complete parameter list, you can create a simple batch file as follows:

@echo off
echo %*

Save this as, for example, testlaunch.bat.

Then, in the Minecraft launcher, Edit Profile and set the Java Settings > Executable to this testlaunch.bat file (wherever you put it). Hit the Play button and now the Development Console will show the full command-line, including all the authentication info.

Don't forget to set the launcher back to its original java executable when you're done.

2
  • This testlaunch.bat trick is excellent! Thank you!
    – tim_hutton
    Commented Jun 17, 2015 at 12:11
  • i had written a whole application to dump arguments via image file execution options...
    – beppe9000
    Commented Sep 29, 2015 at 13:28
2

As the command line parameters seem to change with every release (currently on 1.7.10), here's another way (besides editing the profile to run a .bat file) to find out how to run Minecraft from the command line.

Download and run Sysinternals' Procmon, then start Minecraft via the launcher and leave it running. Pause event capturing in Procmon, then find your Minecraft instance in the event list (called javaw.exe - there will be one running the launcher and one running Minecraft), right click it and select Properties. You will find the full command line there, copy it for later.

Regardless how you found the full command line, you must do this:

Make a copy of the directory %APPDATA%\.minecraft\versions\1.7.10\1.7.10-natives-1234567890 (the trailing number changes every time) and call it, say, my-1.7.10-natives. This is necessary because the original natives directory is deleted every time after you quit Minecraft.

Lastly, take the command line you copied earlier and modify the -Djava.library.path parameter to the directory you created. You are now ready to run Minecraft from the command line.

0

Just create this batch command file in your game directory. Bat file takes one argument %1 as the username.

Also, I use a splash screen to make pretty. You will NOT be able to play online, but who cares.

Adjust your memory usage to fit your machine (-Xmx & -Xmns).

NOTE: this is for version of minecraft as of 2016-06-27

@ECHO OFF
SET DIR=%cd%
SET JAVA_HOME=%DIR%\runtime\jre-x64\1.8.0_25
SET JAVA=%JAVA_HOME%\bin\java.exe
SET LOW_MEM=768M
SET MAX_MEM=2G
SET LIBRARIES=versions\1.10.2\1.10.2-natives-59894925878961
SET MAIN_CLASS=net.minecraft.client.main.Main
SET CLASSPATH=libraries\com\mojang\netty\1.6\netty-1.6.jar;libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar;libraries\net\java\dev\jna\jna\3.4.0\jna-3.4.0.jar;libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;libraries\net\sf\jopt-simple\jopt-simple\4.6\jopt-simple-4.6.jar;libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;libraries\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar;libraries\com\google\guava\guava\17.0\guava-17.0.jar;libraries\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar;libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;libraries\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;libraries\com\mojang\authlib\1.5.22\authlib-1.5.22.jar;libraries\com\mojang\realms\1.9.3\realms-1.9.3.jar;libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;libraries\it\unimi\dsi\fastutil\7.0.12_mojang\fastutil-7.0.12_mojang.jar;libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;libraries\org\lwjgl\lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar;libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar;versions\1.10.2\1.10.2.jar
SET JAVA_OPTIONS=-server -splash:splash.png -d64 -da -dsa -Xrs -Xms%LOW_MEM% -Xmx%MAX_MEM% -XX:NewSize=%LOW_MEM% -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Djava.library.path=%LIBRARIES% -cp %CLASSPATH%  %MAIN_CLASS%

start /D %DIR% /I /HIGH %JAVA% %JAVA_OPTIONS% --username %1 --version 1.10.2 --gameDir %DIR% --assetsDir assets --assetIndex 1.10 --uuid 2536abce90e8476a871679918164abc5 --accessToken 99abe417230342cb8e9e2168ab46297a --userType legacy --versionType release --nativeLauncherVersion 307

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.