Minecraft – Does the 1.6 minecraft launcher have command-line options to go directly to a profile

minecraft-java-edition

I have two kids with different Minecraft accounts on the same Linux computer.

Previously, I made each of them an icon which ran this:

java -cp ~/minecraft/minecraft.jar net.minecraft.LauncherFrame -u=email@example.org -p=password servername.example.org:3000

with a separate email and password for each kid.

This does not seem to work with the new launcher, which actually has the concept of separate-user profiles, but ironically ends up being quite a bit less elegant than this. (I asked on a minecraft forum site, but only got "why would you want to do that?")

Is there a way to similarly specify the profile to launch and server to connect to on the command line of the new launcher?

Best Answer

You can make separate work directories for the launcher and start it like this:

java -jar ~/minecraft/Minecraft.jar --workDir ~/minecraft/user1/
java -jar ~/minecraft/Minecraft.jar --workDir ~/minecraft/user2/
#etc

(For Windows users, just specify the folders as you normally would: e.g. java -jar "D:\Games\Minecraft\Minecraft.jar" --workDir "D:\Games\Minecraft\User1\")

By doing this, you will get completely separate environments for the game, so each one of them will keep its own login data (you still need to press the "Play" button), but will also have separate worlds and resource packs, and the launcher will download/update the game separately.
However, that can behavior can be changed, especially easily on Linux. You can share the singleplayer worlds, for example, if you make a symlink to one environment's saves folder in other folder(s).

There seems to be no way to connect to a server with a command line parameter, because the only command line parameters the launcher accepts right now are: work directory, proxy server, force update. (use --help to look at that)