【问题标题】:Autoconnection to server with minecraft arguments使用 minecraft 参数自动连接到服务器
【发布时间】:2020-07-03 11:29:53
【问题描述】:

我正在使用 c# 开发简单的 minecraft 启动器。我想在用户启动 minecraft 时使用 IP 地址和端口自动将用户连接到我们的服务器。

为了启动我的世界,我使用带有特定参数的进程:

minecraftGame.StartInfo = new ProcessStartInfo("java");
minecraftGame.StartInfo.Arguments = CreateCommand();

CreateCommand() 函数创建正确启动游戏所需的每个参数:

arguments.Append("--username ");
arguments.Append(CommonData.launcherProfileJson.authenticationDatabase.selectedProfile.name + " ");
arguments.Append("--version ");
arguments.Append(ManifestManager.minecraftVersionJson.Id + " ");
arguments.Append("--gameDir ");
arguments.Append(CommonData.aramisFolder + " ");
arguments.Append("--assetsDir ");
arguments.Append(CommonData.aramisFolder + "assets/ ");
arguments.Append("--assetIndex ");
arguments.Append(ManifestManager.minecraftVersionJson.Assets + " ");
arguments.Append("--uuid ");
arguments.Append(CommonData.launcherProfileJson.authenticationDatabase.selectedProfile.id + " ");
arguments.Append("--accessToken ");
arguments.Append(CommonData.launcherProfileJson.authenticationDatabase.accessToken + " ");
arguments.Append("--userType ");
arguments.Append("mojang ");
arguments.Append("--versionType ");
arguments.Append("Vanilla ");

有人知道将 minecraft 自动连接到服务器的命令吗?

我试过这个:

arguments.Append("--versionType ");
arguments.Append("Vanilla ");
arguments.Append("mc.hypixel.net:25565 ");

但是命令被忽略了。

然后按照page : 我试图将行 arguments.Append("mc.hypixel.net:25565 "); 移动到第三个位置(以及其他一些位置)。但它仍然不起作用,并且命令被忽略。有人有想法吗?

非常感谢!

再见。

【问题讨论】:

    标签: minecraft


    【解决方案1】:

    我找到了解决方案。您可以使用特定的参数 --server 和 --port

    再见

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-16
      • 1970-01-01
      • 1970-01-01
      • 2021-07-28
      • 1970-01-01
      相关资源
      最近更新 更多