Jump to content

How to launch a single player game through command line?


music7box

Recommended Posts

I need to launch the game without showing main menu for simplicity.

 

Now I know how to connect to a (remote) server and join its running world directly (without showing main menu) by passing --server and --port command args to launch the game. It works pretty well.

 

But I have no idea on how to create a single player world or reenter the single player world created before directly without main menu.

 

I really need this functionality. Please help me. Many thanks in advance.

 

 

 

Here are the information I've collected.

optionparser.accepts("server").withRequiredArg();

optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565), new Integer[0]);

optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File("."), new File[0]);

optionparser.accepts("assetsDir").withRequiredArg().ofType(File.class);

optionparser.accepts("resourcePackDir").withRequiredArg().ofType(File.class);

optionparser.accepts("proxyHost").withRequiredArg();

optionparser.accepts("proxyPort").withRequiredArg().defaultsTo("8080", new String[0]).ofType(Integer.class);

optionparser.accepts("proxyUser").withRequiredArg();

optionparser.accepts("proxyPass").withRequiredArg();

optionparser.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]

optionparser.accepts("uuid").withRequiredArg();

optionparser.accepts("accessToken").withRequiredArg().required();

optionparser.accepts("version").withRequiredArg().required();

optionparser.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]);

optionparser.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]);

optionparser.accepts("userProperties").withRequiredArg().required();

optionparser.accepts("assetIndex").withRequiredArg();

optionparser.accepts("userType").withRequiredArg().defaultsTo("legacy", new String[0]);

 

Above are Minecraft Launch Parameters Arguments I copied from forge source code.

So basically we have these parameters to pass when launching the game:

server

port

gameDir

assetsDir

resourcePackDir

proxyHost

proxyPort

proxyUser

proxyPass

username

uuid

accessToken

version

width

height

userProperties

assetIndex

userType

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.