VOOZH about

URL: https://minecraft.wiki/w/Java_Edition_client_command_line_arguments

โ‡ฑ Java Edition client command line arguments โ€“ Minecraft Wiki


Java Edition client command line arguments

From Minecraft Wiki
Jump to navigation Jump to search

When starting the Java Edition client, the Minecraft Launcher passes various command line arguments to the Java virtual machine, such as the path to the game itself and account login information. These arguments are chosen based on the contents of the client.json file corresponding to the selected version, options set in the launcher, and the current operating system.

Command line parts

[edit | edit source]

The complete command used to start the Java virtual machine consists of the following parts:

JVM arguments

[edit | edit source]
Argument Description
-Djava.library.path=<library natives folder> Sets the folder containing the library natives. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/bin/<natives folder>/java.
-Djna.tmpdir=<JNA temporary folder> Sets the folder Java Native Access uses for temporary files. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/bin/<natives folder>/jna.
-Dorg.lwjgl.system.SharedLibraryExtractPath=<LWJGL natives folder> Sets the folder containing the LWJGL natives. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/bin/<natives folder>/lwjgl.
-Dio.netty.native.workdir=<Netty natives folder> Sets the folder containing the Netty natives. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/bin/<natives folder>/netty.
-Dminecraft.launcher.brand=<launcher name> Sets the name of the launcher. Included in crash reports and telemetry.
-Dminecraft.launcher.version=<launcher version> Sets the version of the launcher. Ignored by the game.
-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump Supposedly makes Intel drivers on laptops with two GPUs use the dedicated GPU.[1]
-XstartOnFirstThread Tells the JVM to start on the first thread.
Some macOS versions require this while others break with it, leaving the game stuck as "not responding".
-Xms<initial memory> Sets the initial memory used in bytes.
-Xmx<maximum memory> Sets the maximum memory used in bytes.
-Xss<stack memory> Sets the memory used for the stack in bytes.

All byte counts can be suffixed with K for kilobytes, M for megabytes or G for gigabytes, each of which is equivalent to 1024 of the previous.

Game arguments

[edit | edit source]
Argument Description
--version <version name> Sets the name of the version. Required to start the game. Specified in client.json and version_manifest.json under id. Shown in the debug screen and in crash reports.
--versionType <version type> Sets the type of the version. Usually release, snapshot, old_beta or old_alpha, specified in client.json and version_manifest.json under type. Defaults to release.
--accessToken <access token> Sets the token generated during the login. Required to start the game. An invalid token will allow singleplayer but show any error when attempting to join a server. The format depends on the authentication scheme.
--username <player name> Sets the player's name used for singleplayer. Must match the name of the account for multiplayer. Defaults to Player followed by the millisecond component of the current system time, which is essentially a random integer from 0 to 999.
--uuid <UUID> Sets the player's UUID. Hyphens are optional. If the access token is valid, then the UUID must match that account for both singleplayer and multiplayer. Defaults to a UUID generated from the player's name.
--xuid <XUID> Sets the player's Xbox User ID.
--demo Switches the game to demo mode.
--offlineDeveloperMode Switches the game to offline developer mode.
--clientId <client ID> Sets the ID included in telemetry. Usually the UUID from ๐Ÿ‘ File file.png: Sprite image for file in Minecraft
 clientId_v2.txt in .minecraft, encoded as base64. Defaults to not including an ID in the telemetry data.
--gameDir <game folder> Sets the folder for the instance's files. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft. Defaults to the current working directory.
--assetsDir <assets folder> Sets the folder that contains, among others, the ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 objects folder. Usually ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/assets. Defaults to ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 assets in the instance's files.
--resourcePackDir <resource pack folder> Sets the folder for resource packs. Defaults to ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 resourcepacks in the instance's files.
--assetIndex <assets index name> Sets the name (without .json) of the JSON file located in ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 indexes in the assets folder to use for mapping internal names to indexes into the ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 assets/objects folder. The index name depends on the game's version.โ€‹[more information needed]
--width <width> Sets the initial width of the game's window. Defaults to 854.
--height <height> Sets the initial height of the game's window. Defaults to 480.
--fullscreen Enables fullscreen.
--fullscreenWidth <horizontal fullscreen resolution> Set fullscreen resolution to use and store in the options when starting the game for the first time. Must be one of the resolutions selectable with the in-game slider.
--fullscreenHeight <vertical fullscreen resolution>
--disableMultiplayer Disables the multiplayer and realms buttons.
--disableChat Disables sending and seeing public and private messages in multiplayer and worlds opened to LAN. Commands and server messages are allowed.
Most servers send player messages as server messages, reimplement private messages, and sometimes even offer commands to send public messages, which mostly or entirely nullifies this argument.
--quickPlaySingleplayer [<world folder name>] Automatically joins the singleplayer world once the game has started. Defaults to the most recently played world if the folder name is omitted.
--quickPlayMultiplayer <server address> Automatically joins the server once the game has started.
--quickPlayRealms <Realm ID> Automatically joins the Realm once the game has started.
--quickPlayPath <quick play logs path> Sets the path to the file to write Quick Play logs to, relative to the instance's files.
--checkGlErrors Does nothing. It is accepted and ignored.
--renderDebugLabels Names GPU calls to make them identifiable in debugging.
--vulkanValidation Detects Vulkan errors instead of ignoring them and enables render debug labels.
--graphicsBackend <graphics backend> Sets the graphics backend of Minecraft. Must be default, opengl or vulkan. Defaults to default.
--jfrProfile Starts profiling with JDK Flight Recorder on game launch.
--tracy Starts profiling with Tracy on game launch.
--tracyNoImages Disables capturing frames to display in the timeline when debugging with Tracy.
--proxyHost <proxy host> Routes traffic through a proxy.
--proxyPort <proxy port> Sets the port of the proxy. Defaults to 8080.
--proxyUser <proxy username> Set the authentication for the used proxy. Required for multiplayer when using a proxy.
--proxyPass <proxy password>

Legacy arguments

[edit | edit source]
Argument Description Versions
--session <session authentication> The session ID used to authenticate with Mojang while connecting to servers.
Defined as: token:<access authentication token>:<authentication UUID>.
13w16a to 13w39b
--userProperties <user properties> unknownโ€‹[more information needed] 13w47a to 25w31a
--profileProperties <profile properties> unknownโ€‹[more information needed] 1.8.1-pre1 to 25w31a
--server <server address> The same as the new --quickPlayMultiplayer <server address>[:<server port>]. until 23w13a
--port <server port>
--workDir <game folder> The same as the new --gameDir <game folder>. 13w16a to 13w23b
--dataPackDir <data pack folder> Did nothing. It was accepted and ignored. 1.16-pre1 to 21w13a
--assetsDir <assets folder> The assets folder. Presumably ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/assets/virtual/legacy by default.โ€‹[more information needed]
until 13w48b
--userType <authentication scheme> The authentication scheme used for logging in.

msa for Microsoft authentication
mojang for Yggdrasil (Legacy Mojang authentication)
legacy for Legacy Minecraft authentication

1.7.3 to 1.21.8

Launch wrapper arguments

[edit | edit source]

Minecraft versions 1.5.2 and prior use a wrapper class to launch the game, which has different arguments than Minecraft itself. This is so they can be properly launched by the Minecraft Launcher.

Argument Description
--version <version> The name of the version.
--gameDir <game folder> The folder for the instance's files. ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft by default.
--assetsDir <assets folder> The folder that contains, among others, the ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 objects folder. ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/assets by default.
--tweakClass <tweaker class> An optional class implementing net.minecraft.launchwrapper.ITweaker that can modify other classes while the game is starting.
The vanilla tweakers are in the net.minecraft.launchwrapper package, for example net.minecraft.launchwrapper.VanillaTweaker.

Main class

[edit | edit source]

A version's default main class is in its version.json under mainClass.

Class Versions Source
net.minecraft.client.main.Main after release 1.5.2
net.minecraft.launchwrapper.Launch Alpha v1.0.11 through release 1.5.2 new launcher
net.minecraft.client.Minecraft old launcher
<obfuscated> start of Alpha through Alpha v1.0.5_01 launcher
net.minecraft.client.MinecraftApplet Alpha website applet
net.minecraft.minecraft.<obfuscated> Indev and Infdev launcher
net.minecraft.client.MinecraftApplet website applet
com.mojang.minecraft.<obfuscated> Classic 0.0.13a_03 through end of Classic launcher
com.mojang.minecraft.Minecraft start of Classic through Classic 0.0.13a
com.mojang.minecraft.MinecraftApplet Classic website applet
com.mojang.minecraft.RubyDung late pre-Classic
com.mojang.rubydung.RubyDung early pre-Classic

Assets

[edit | edit source]

The launcher downloads additional required resources and saves them to ๐Ÿ‘ File directory.png: Sprite image for directory in Minecraft
 .minecraft/assets to be used by the game.

Minecraft requires several arguments when launched.

Since 1.12.2, they are defined in client.json under arguments.

Before that, the game arguments were defined in client.json under minecraftArguments while the JVM arguments were defined directly in the launcher.

History

[edit | edit source]
Java Edition Classic
?Added username, sessionid, loadmap_user, loadmap_id, and mppass as applet parameters.
?Added server and port as applet parameters.
?Added fullscreen as an applet parameter.
Java Edition Beta
1.3bRemoved loadmap_user and loadmap_id.
Java Edition
1.0Added stand-alone as an applet parameter.
1.3.112w16aAdded demo as an applet parameter and --demo as a command line argument.
12w18aAdded --server-path and --server-entry as command line arguments.
12w19aAdded server-entry and server-loc as applet parameters.
Added --applet as a command line argument.
Removed mppass.
12w30aRemoved --server-path, --server-entry, server-entry, and server-loc.
1.4.212w42aAdded --password as a command line argument.
1.6.113w16aAdded --workDir, --proxyHost, --proxyPort, --proxyUser, --proxyPass, --username and --session.
Removed sessionid, stand-alone, --applet and --password.
Minecraft no longer uses a Java Applet. As such, certain applet parameters were made command line arguments:
username to --username
server to --server
port to --port
fullscreen to --fullscreen
demo merged with --demo.
13w23aAdded --version.
13w24aAdded --gameDir and --assetsDir.
Removed --workDir.
13w25aAdded --width and --height.
13w25bAdded --resourcePackDir.
1.7.213w36aAdded --uuid.
13w38aAdded --accessToken.
13w41aRemoved --session.
1.7.413w47aAdded --userProperties.
13w49aAdded --assetIndex.
1.7.3Added --userType.
1.814w25aAdded --checkGlErrors.
1.8.1pre1Added --profileProperties.
1.916w05bAdded --versionType.
1.1317w43aAdded --fullscreenWidth and --fullscreenHeight.
1.1620w21aAdded --disableMultiplayer and --disableChat.
pre1Added --dataPackDir.
1.1721w14aRemoved --dataPackDir.
1.1821w38aAdded --xuid and --clientId.
1.2023w14aAdded --quickPlayPath, --quickPlaySingleplayer, --quickPlayMultiplayer, and --quickPlayRealms.
Removed --server and --port.
1.21.224w37aAdded --tracy and --tracyNoImages.
1.21.525w09aAdded --renderDebugLabels.
1.21.625w19a--quickPlaySingleplayer can now be used without an identifier to launch into the last played world.
1.21.925w31aAdded --offlineDeveloperMode.
Removed --userType.
25w32aRemoved --userProperties and --profileProperties.
26.2snap1Added --vulkanValidation.
snap2Added --graphicsBackend.

References

[edit | edit source]
Retrieved from "https://minecraft.wiki/w/Java_Edition_client_command_line_arguments?oldid=3647710"

Navigation menu