13

For 1.6.1, there's a new launcher. Unfortunately, I find myself sitting at the launcher for just long enough to get rather annoyed before I'm allowed to click the 'play' button. I usually launch the launcher from Steam; is there some way to point directly to the version I want to play and only use the launcher when I'm doing something odd?

4
  • Give this a try.
    – pinckerman
    Apr 15, 2023 at 15:25
  • @pinckerman You mean install multimc?
    – minseong
    Apr 15, 2023 at 19:54
  • Yes, does it work?
    – pinckerman
    Apr 15, 2023 at 20:01
  • @pinckerman not really. I downloaded it, ran it from the command line as I saw here, but it spawned a GUI, took me through a lot of configuration, and then didn't launch any Minecraft. I think I have to use MultiMC itself to set up profiles etc., before I can finally run instances of the game, and even then I don't know how to launch vanilla profiles from the command line.
    – minseong
    Apr 16, 2023 at 20:54

5 Answers 5

16

Yes

My earlier post was wrong, sorry, it was launching an old version and I didn't realise.

What you need to do for 1.6.1 is a little more complex.

First, you'll need to launch from the launcher. Assuming Minecraft launches ok, you'll get a load of output in the Development Console. What you need to look for is a line that looks a bit like this (yes, it's very long!):

java -Xmx1G -Djava.library.path=%APPDATA%\.minecraft\versions\1.6.1\1.6.1-natives-10107774015424 -cp %APPDATA%\.minecraft\libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;%APPDATA%\.minecraft\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;%APPDATA%\.minecraft\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;%APPDATA%\.minecraft\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;%APPDATA%\.minecraft\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;%APPDATA%\.minecraft\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;%APPDATA%\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl\2.9.0\lwjgl-2.9.0.jar;%APPDATA%\.minecraft\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.0\lwjgl_util-2.9.0.jar;%APPDATA%\.minecraft\libraries\argo\argo\2.25_fixed\argo-2.25_fixed.jar;%APPDATA%\.minecraft\libraries\org\bouncycastle\bcprov-jdk15on\1.47\bcprov-jdk15on-1.47.jar;%APPDATA%\.minecraft\libraries\com\google\guava\guava\14.0\guava-14.0.jar;%APPDATA%\.minecraft\libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;%APPDATA%\.minecraft\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;%APPDATA%\.minecraft\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;%APPDATA%\.minecraft\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;%APPDATA%\.minecraft\libraries\com\google\code\gson\gson\2.2.2\gson-2.2.2.jar;%APPDATA%\.minecraft\versions\1.6.1\1.6.1.jar net.minecraft.client.main.Main --username %YOUR_USERNAME% --session token:%SOME_TOKEN% --version 1.6.1 --gameDir %APPDATA%\.minecraft --assetsDir %APPDATA%\.minecraft\assets

I've edited mine a bit to remove system-specific data, it'll probably start with something like
Running C:\Program Files\Java\jre7\bin\javaw.exe

Close Minecraft, but not the launcher. You will see some lines at the end of the Dev Console that read something like

Game ended with no troubles detected (exit code 0)
Deleting C:\Users\fredley\AppData\Roaming\.minecraft\versions\1.6.1\1.6.1-natives-11569750504590
Couldn't delete C:\Users\fredley\AppData\Roaming\.minecraft\versions\1.6.1\1.6.1-natives-11569750504590 - scheduling for deletion upon exit

This is obviously a problem! Make a copy of the 1.6.1-natives-11569750504590 folder (just make a copy in the same folder called 1.6.1-natives-backup in the same folder). Edit your command so that it uses your backup copies (just paste it in a text editor and find-replace 11569750504590 with backup).

Don't use my command, as it will not work. Account/session data is in the command so you must use your own copy as generated by the launcher.

Copy your entire, edited command (excluding Running at the start), and save it somewhere. You can then launch from cmd using this command at any time.

If you want to have an icon to launch Minecraft it's as simple as right-clicking your desktop, selecting New > Shortcut and entering this command as the 'file'.

3
  • 1
    A note that the contents of the natives folder copy should be updated with each new release would be a good addition. Jul 6, 2013 at 17:55
  • 1
    Good answer, but outdated with one thing: the token etc is not included in the launcher log anymore. I had to set up a fake java binary, actually being a shell script writing the arguments to a file, so I could simply see what the launcher was actually doing. The natives-folder trick is still necessary. / I dont know how to get a token otherwise, so that my workaround could be skipped. Can probably found somewhere on wiki.vg/Main_Page or similar. it is enough for me for now
    – Blauhirn
    Mar 23, 2019 at 19:57
  • I know this is very late, but how would I see the Development Console on the latest version of the Minecraft Launcher? I am on a Mac, Dec 28, 2020 at 18:16
3

Skipping the launcher

Here's my approach for creating a Windows batch script that will run Minecraft and skip the launcher:

  • Download process explorer
  • Run the Minecraft launcher and open Minecraft with the exact version and configuration which you want to use
  • Run process explorer and find the Minecraft process (it'll be a javaw.exe process under the tree of the Minecraft launcher) Minecraft javaw.exe process in Process Explorer
  • Double-click on the process to view details and copy the command line used to run it
  • Paste the command into a batch script (a text file with .bat extension)
  • Save the batch script into your .minecraft directory: %appdata%/.minecraft
  • The command will include a -Djava.library.path= which (in Minecraft v1.13) points to a temporary directory which only exists while Minecraft is still open. While it exists, copy that directory somewhere and then change the -Djava.library.path= configuration to point to the new location.

You can now run that script by double clicking on it.

NOTE: Be careful never to share the script or the full command you copied as it includes a session token for logging in using your own Mojang account.

Running the script from Steam

I also wanted to run Minecraft through the Steam launcher and specifically needed to skip the Minecraft launcher so that Steam can properly stream Minecraft to a Steam Link. However, Steam's "Add a non-Steam game" feature only allows you to select executables with an .exe extension.

To run the newly created batch script from Steam, you can:

  • Add a non-Steam game and choose any application/game
  • Right-click on the newly added application in your Steam game list and select properties
  • Change the target field to point to your new batch script and the start in field to point to it's directory, and then also change the name/icon to identify it as Minecraft.
1
  • I've been using this method forever, it always worked until mincraft 1.19, "points to a temporary directory which only exists while Minecraft is still open". Since 1.19 it doesn't create a folder anywhere. any ideas? Thanks.
    – Xane
    Oct 21, 2023 at 14:53
2

Because the way that the game is launched can change across Minecraft versions and platform, the most reliable way to find out how you can run the game without the launcher is to find out how the launcher itself runs the game.

Do that by trapping the launcher's launch command, and recording what it was.

In the launcher, click on "More options" and change the Java Executable (JRE executable) to a custom program that captures and logs all of the arguments and environment variables passed to it.

I've made a Python script that acts as that custom man-in-the-middle program. If you trust this code, then you can use it yourself.

Just save the code into some file (remember code you copy/paste from the internet and run on your computer has the power to access everything on your computer if it wants, be careful), then chmod a+x the file if you're not on Windows.

#!/usr/bin/env python3
import datetime
import os
import stat
import sys

from bisect import bisect_left
from functools import partial
from pathlib import Path
from shlex import quote


r'''Where to write the generated command (relative to the minecraft folder)'''
OUTFILE = 'launch.sh'


r'''Version number of Minecraft the command is for'''
VERSION = '1.8.8'


r'''The environment variables that might be important, and should be enabled in the output'''
ENVIRONMENT = ('PWD')


# these can only be found by inspecting the official launcher's Minecraft process
KNOWN_JRES = {
    '1.8.8': '"$HOME/Library/Application Support/minecraft/runtime/jre-legacy/mac-os/jre-legacy/jre.bundle/Contents/Home/bin/java"',
    '1.19.4': '"$HOME/Library/Application Support/minecraft/runtime/java-runtime-gamma/mac-os/java-runtime-gamma/jre.bundle/Contents/Home/bin/java"'
}


HOME = '"$HOME"'


def should_comment(env_name):
    r'''For the environment variable name, returns whether it should be commented out in the generated output'''
    return env_name not in ENVIRONMENT


def get_umask():
    umask = os.umask(0)
    os.umask(umask)
    return umask


def chmod_plus_x(path):
    r'''Does what chmod +x path does at the command line.

    Function rom https://stackoverflow.com/a/55591471/3310334
    '''
    os.chmod(
        path,
        os.stat(path).st_mode |
        (
            (
                stat.S_IXUSR |
                stat.S_IXGRP |
                stat.S_IXOTH
            )
            & ~get_umask()
        )
    )


def anonymise(path):
    r'''Replaces any /User/name with $HOME, and shell-quotes the output'''
    return HOME.join([quote(part) if part else part for part in path.split(str(Path.home()))])


def nearest_jre(semver):
    r'''Return the JRE that this version most likely uses'''
    try:
        return KNOWN_JRES[semver]
    except KeyError:
        target = semver.split('.')
        versions, jres = list(zip(*((tuple(v.split('.')), jre) for v, jre in KNOWN_JRES.items())))
        left = bisect_left(versions, target)
        if left == 0 or left == len(jres) - 1:
            return jres[left]
        right = left + 1
        for l, r, t in zip(versions[left], versions[right], target):
            if t - l > t - r:
                return versions[right]
            elif t - l < t - r:
                return versions[left]
        assert False, 'unreachable'


if __name__ == '__main__':
    original_stdout = sys.stdout
    path = Path.home() / 'Library/Application Support/minecraft' / OUTFILE
    with open(path, 'w') as f:
        sys.stdout = f
        print('#!/bin/sh')
        print('')
        print('# Generated Launcher Command')
        print(f'# Generated at: {datetime.datetime.now()}')
        print('')
        for name, value in sorted(os.environ.items(), key=lambda p: should_comment(p[0]), reverse=True):
            comment_leader = '# ' if should_comment(name) else ''
            print(f"{comment_leader}{name}={anonymise(value)}")
        args = sys.argv[1:]
        print(nearest_jre(VERSION) + (' \\' if args else ''))
        args_iter = enumerate(args)
        for i, arg in args_iter:
            print(('    ' if i == 0 else ' \\\n    ') + anonymise(arg), end='')
            if arg == '-cp':
                try:
                    i, arg = next(args_iter)
                    cp = arg
                    jars = cp.split(':') # maybe this will break if paths can have : in them
                    version = jars[-1]
                    print(' \\\n    "$(')
                    libraries = jars[:-1]
                    if libraries:
                        library_prefix = str(Path.home() / 'Library/Application Support/minecraft/libraries') + '/'
                        print(f"        printf {anonymise(library_prefix)}%s:", end='')
                        for library in libraries:
                            print(f" \\\n            {library.removeprefix(library_prefix)}", end='')
                    print(f'\n        printf {anonymise(version)}')
                    print('    )"', end='')
                except StopIteration:
                    pass
        print()
    sys.stdout = original_stdout
    chmod_plus_x(path)

Then set that Python file as your JRE in Minecraft Launcher's settings, for the profile you want to run. Then start the profile. The game will not open. Instead, now check the contents of launch.sh in the Minecraft folder now - you will see the command that the launcher just tried to run to start the game. You can run launch.sh as a script or command line to start the game yourself, in exactly the same way the launcher does.

In my case, the command to start the game is:

"$HOME/Library/Application Support/minecraft/runtime/jre-legacy/mac-os/jre-legacy/jre.bundle/Contents/Home/bin/java" \
    -XstartOnFirstThread \
    -Xss1M \
    -Djava.library.path="$HOME"'/Library/Application Support/minecraft/bin/dc09a151c781663d2e2cbb3b1748815531cfb52b' \
    -Dminecraft.launcher.brand=minecraft-launcher \
    -Dminecraft.launcher.version=2.4.79 \
    -cp \
    "$(
        printf "$HOME"'/Library/Application Support/minecraft/libraries/'%s: \
            ca/weblite/java-objc-bridge/1.1/java-objc-bridge-1.1.jar \
            com/github/oshi/oshi-core/6.2.2/oshi-core-6.2.2.jar \
            com/google/code/gson/gson/2.10/gson-2.10.jar \
            com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar \
            com/google/guava/guava/31.1-jre/guava-31.1-jre.jar \
            com/ibm/icu/icu4j/71.1/icu4j-71.1.jar \
            com/mojang/authlib/3.18.38/authlib-3.18.38.jar \
            com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar \
            com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar \
            com/mojang/datafixerupper/6.0.6/datafixerupper-6.0.6.jar \
            com/mojang/logging/1.1.1/logging-1.1.1.jar \
            com/mojang/patchy/2.2.10/patchy-2.2.10.jar \
            com/mojang/text2speech/1.16.7/text2speech-1.16.7.jar \
            commons-codec/commons-codec/1.15/commons-codec-1.15.jar \
            commons-io/commons-io/2.11.0/commons-io-2.11.0.jar \
            commons-logging/commons-logging/1.2/commons-logging-1.2.jar \
            io/netty/netty-buffer/4.1.82.Final/netty-buffer-4.1.82.Final.jar \
            io/netty/netty-codec/4.1.82.Final/netty-codec-4.1.82.Final.jar \
            io/netty/netty-common/4.1.82.Final/netty-common-4.1.82.Final.jar \
            io/netty/netty-handler/4.1.82.Final/netty-handler-4.1.82.Final.jar \
            io/netty/netty-resolver/4.1.82.Final/netty-resolver-4.1.82.Final.jar \
            io/netty/netty-transport-classes-epoll/4.1.82.Final/netty-transport-classes-epoll-4.1.82.Final.jar \
            io/netty/netty-transport-native-unix-common/4.1.82.Final/netty-transport-native-unix-common-4.1.82.Final.jar \
            io/netty/netty-transport/4.1.82.Final/netty-transport-4.1.82.Final.jar \
            it/unimi/dsi/fastutil/8.5.9/fastutil-8.5.9.jar \
            net/java/dev/jna/jna-platform/5.12.1/jna-platform-5.12.1.jar \
            net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar \
            net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar \
            org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar \
            org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar \
            org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar \
            org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar \
            org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar \
            org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar \
            org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.jar \
            org/joml/joml/1.10.5/joml-1.10.5.jar \
            org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar \
            org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1.jar \
            org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1.jar \
            org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1.jar \
            org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1.jar \
            org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1.jar \
            org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1-natives-macos-arm64.jar \
            org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1.jar \
            org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1-natives-macos.jar \
            org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1-natives-macos-arm64.jar \
            org/slf4j/slf4j-api/2.0.1/slf4j-api-2.0.1.jar
        printf "$HOME"'/Library/Application Support/minecraft/versions/1.19.4/1.19.4.jar'
    )" \
    -Xmx2G \
    -XX:+UnlockExperimentalVMOptions \
    -XX:+UseG1GC \
    -XX:G1NewSizePercent=20 \
    -XX:G1ReservePercent=20 \
    -XX:MaxGCPauseMillis=50 \
    -XX:G1HeapRegionSize=32M \
    -Dlog4j.configurationFile="$HOME"'/Library/Application Support/minecraft/assets/log_configs/client-1.12.xml' \
    net.minecraft.client.main.Main \
    --username \
    <censored> \
    --version \
    1.19.4 \
    --gameDir \
    "$HOME"'/Library/Application Support/minecraft' \
    --assetsDir \
    "$HOME"'/Library/Application Support/minecraft/assets' \
    --assetIndex \
    3 \
    --uuid \
    <censored> \
    --accessToken \
    <censored> \
    --clientId \
    <censored> \
    --xuid \
    <censored> \
    --userType \
    msa \
    --versionType \
    release

1

So I have found a solution. I am using Electron (https://www.electronjs.org/) and Node JS to build my Minecraft Launcher. And I have found a npm package that gives exactly what I want: https://github.com/Pierce01/MinecraftLauncher-core.

This package uses Node JS to launch Minecraft with authentication and all.

-2

In Steam: Library --> right click game --> create desktop shortcut

1
  • 4
    Minecraft isn't on Steam. (The Story Mode is an entirely different game.)
    – DJ Pirtu
    May 18, 2016 at 14:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .