Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My problem is that I can run minecraft from a different folder, but when I run it, it is still using .minecraft folder. It saves the worlds there and so on. How can I run it like "everything get from and save to my folder"? I heard you can mod it to run from somewhere else, but I did not found it anywhere.

        public static string generateSession(string username, string password, int clientVer)
        return httpGET("" + username + "&password=" + password + "&version=" + clientVer);

    private static string httpGET(string URI)
        WebRequest req = WebRequest.Create(URI);
        WebResponse resp = req.GetResponse();
        StreamReader sr = new StreamReader(resp.GetResponseStream());
        return sr.ReadToEnd().Trim();

    public static void startMinecraft(bool mode, int ramMin, int ramMax, string username, string sessionID, bool debug, int modpack)
        string appPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\";
        string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\";
        string mcFolder;
        //Launching a modpack
        if (modpack == 0)
            mcFolder = @".gslauncher\vanilla";
        else mcFolder = @".gslauncher\gstech";
        Process proc = new Process();
        if (debug == true)
            proc.StartInfo.FileName = "java";
            proc.StartInfo.FileName = "javaw";
        //Online and offline modes
        if (mode == true)
            proc.StartInfo.Arguments = "-Xms" + ramMin + "m -Xmx" + ramMax + "m -Djava.library.path=" + appData + mcFolder + "/bin/natives -cp " + appData + mcFolder + "/bin/minecraft.jar;" + appData + mcFolder + "/bin/jinput.jar;" + appData + mcFolder + "/bin/lwjgl.jar;" + appData + mcFolder + "/bin/lwjgl_util.jar net.minecraft.client.Minecraft " + username + " " + sessionID;
            proc.StartInfo.Arguments = "-Xms" + ramMin + "m -Xmx" + ramMax + "m -Djava.library.path=" + appData + mcFolder + "/bin/natives -cp " + appData + mcFolder + "/bin/minecraft.jar;" + appData + mcFolder + "/bin/jinput.jar;" + appData + mcFolder + "/bin/lwjgl.jar;" + appData + mcFolder + "/bin/lwjgl_util.jar net.minecraft.client.Minecraft " + username;
share|improve this question

closed as off topic by Maik Semder, Byte56, Trevor Powell, Sean Middleditch, Josh Petrie Jan 11 '13 at 4:04

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I think this fits better to – danijar Jan 10 '13 at 17:55
@sharethis really? for real? I got redirected to other sites 3 times since 2 hours – DragonCz Jan 10 '13 at 18:16
Or maybe This certainly isn't the site for working out how to run existing games, that's for sure. – Kylotan Jan 10 '13 at 18:23
I am just modifying (creating something new) for the original game – DragonCz Jan 10 '13 at 18:24
The Minecraft modding forums would be the best place. – Byte56 Jan 10 '13 at 18:27

The Minecraft modding forums is probably the best place to get answers like this. Searching there is your best bet and you can likely find the answer. I did a search there and found that someone had asked this question already. It looks like the best way is to use Magic Launcher. If you want to do it through code, I suggest you ask the question over there.

share|improve this answer
I am not looking for a launcher, I am looking to do it via code, and that is why I am tagging it as C# and posting a chunk of the code I used – DragonCz Jan 10 '13 at 18:55
In that case, I think it's a bit too specialised for this site, and the forum Byte56 mentioned would be the best bet. – Kylotan Jan 10 '13 at 19:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.