-7

i want launch minecraft client with c# but my code doesnt work:

private void Startmc(String a, String b)
    {
        string javafolder = GetJavaInstallationPath();
        string filepath = Path.Combine(javafolder, @"bin\");

        Environment.SetEnvironmentVariable("APPDATA", kurulumdosyasi);

        Process p = new Process();
        ProcessStartInfo psi = new ProcessStartInfo();

        psi.FileName = "javaw";
        psi.CreateNoWindow = true;
        psi.Arguments = "-cp \"" + filepath + ".jar;" + filepath + "lwjgl.jar;" + filepath + "lwjgl_util.jar;" + filepath + "jinput.jar;\" ";
        psi.Arguments += "\"-Djava.library.path=" + filepath + "natives\" -Xmx1024M -Xms512M net.minecraft.client.main.Main " + a + " " + b;
        p.StartInfo = psi;
        p.Start();
    }

after click to login button nothing happen

Arpit
  • 323
  • 4
  • 13
Hasan D.
  • 11
  • 3
  • You might want to elaborate on your intentions. You can't expect us to know what commands Minecraft needs when started from the command line. For the purpose of your question, assume that no one here knows Minecraft or any of its settings. Also note that if the issue isn't in your code, that we can't help (this isn't a Minecraft support forum). – Flater Jul 31 '17 at 11:48
  • What is this `Login` button?? – Matthieu Charbonnier Jul 31 '17 at 12:24

1 Answers1

0

Can't you just open a Process() from the main launcher in the install directory (C:\Program Files (x86)\Minecraft\MinecraftLauncher.exe)? It looks like you're trying to bypass the default behavior...what are you working on?

midoriha_senpai
  • 177
  • 1
  • 16