-
Notifications
You must be signed in to change notification settings - Fork 41
MLaunchOption
var launchOption = new MLaunchOption()
{
// Required Settings
StartVersion = myversion,
Session = MSession.GetOfflineSession("tester123"),
// Optional Settings
MaximumRamMb = 4096,
JavaPath = "javaw.exe",
JVMArguments = new string[] { },
ServerIp = "mc.hypixel.net",
ServerPort = 25565,
ScreenWidth = 1600,
ScreenHeight = 900,
VersionType = "CmlLauncher",
GameLauncherName = "CmlLauncher",
GameLauncherVersion = "2",
FullScreen = false,
// Only macOS
DockName = "",
DockIcon = "",
};
Type: MVersion
The version you want to launch. If you launch game using CMLauncher, you don't have to set this property. CMLauncher will automatically get version and set this.
Type: int
Set -Xmx JVM parameter. It is used to set the maximum heap size of minecraft.
If the value of this property is less than 1, ArgumentException
will be thrown.
Note: You can't set this property exceeding 1024 in 32bit Java.
Type: MSession
Set username, uuid, access_token of player. It is used to connect to online-mode server or realm server.
but if you use MSession.GetOfflineSession, you can't connect these servers.
If the value of this property is null, ArgumentException
will be thrown.
Type: string Optional
Set java path. If this property was empty and call Cml.CreateProcess
, CreateProcess
method will set this property to <Your Game Path>/runtime
, check java existence, and download java if it does not exist.
Type: string Optional
Set ${version_type}. Empty value will set ${version_type} to TypeStr
property of MProfile
class.
VersionType will be shown bottom left of main menu in minecraft. Old minecraft version doesn't support this option.
Type: string Optional
Set ${launcher_name}. Empty value will set ${launcher_name} to minecraft-launcher
, same as default value of mojang launcher.
Type: string Optional
Set ${launcher_version}. Empty value will set ${launcher_name} to 2
, same as default value of mojang launcher.
Type: string Optional
Connect to server directly when minecraft loading is done.
This option doesn't work in 1.15. It is bug of minecraft.
Type: int Optional
Set server port of ServerIp
property. default value is 25565.
Type: string[] Optional
Set JVM parameter. If this property is null
, use default JVM parameter.
Default JVM Parameter :
-XX:+UnlockExperimentalVMOptions,
-XX:+UseG1GC,
-XX:G1NewSizePercent=20,
-XX:G1ReservePercent=20,
-XX:MaxGCPauseMillis=50,
-XX:G1HeapRegionSize=16M
Type: int Optional
Set the resolution of Minecraft. It works when value of two options is bigger than 0. Old minecraft version doesn't support this option.
If one of these option is negative, ArgumentException
will be thrown.
Type: bool Optional
If this property is true, minecraft will turn on FullScreen option. (not permanently) Old minecraft version doesn't support this option.
Type: string Optional
Set dock name of minecraft. It works only in macOS. In some macOS version, you must set this option. More Infomation
Type: string Optional
Set dock icon of minecraft. It should be an absolute file path which of size is 256x256
and icns
format.