With the Minecraft 1.6.x upgrade the launcher no longer has an option to play offline. However this can be accomplished with a startup script. Follow these steps to get a working startup script:
- Start the 1.6.x Minecraft launcher, as you normally do, and login to the game. Logging in is necessary to make sure all of the unlocked game files get downloaded to your system.
- While the game is running put it into windowed mode (f11) and then go to finder and open your home directory. Navigate to “/Users/<your_home_dir>/Library/Application Support/minecraft” (your Library folder may be hidden, so either force it to show via finder preferences or just type the path in by Choosing the “Go > Go to Folder…” option in the Finder menu). Within here you should have a “versions” folder. Navigate to that folder and now you will see subfolders for each version of the game you have played via the new launcher. In my case I have a 1.6.2 folder. Open the version folder for whichever version you currently have running in the background and in there you’ll see a 1.6.2-natives-<random numbers> folder. This folder gets created with a different timestamp (the random numbers) every time you run minecraft via the new launcher. Copy this folder up one directory so it is sitting in the versions folder, and therefore will not be deleted when you quit the instance of Minecraft that is currently running.
- Now go to the Minecraft launcher and click on the “Development Console” tab. Here you’ll see a bunch of output. Starting from the beginning (top) find the line that starts with “Running”. Copy everything after “Running ” up until the line that states “—- YOU CAN CLOSE THIS LAUNCHER IF THE GAME STARTED OK —-“. It should look something like this with <home> being your own home directory name:
- Now we’ll create the file to paste this block of text into. Open a terminal window (Launchpad > Other > Terminal) and go to the minecraft directory we’ve been working in and create a startup script file:
cd /Users/<home>/Library/Application Support/minecraft/
sudo nano startup1.6.2.sh
Paste the clipboard contents into the nano window.
- Here it gets a bit tricky. You need to surround parts of the command line you just pasted with quotes so the spaces don’t get interpreted incorrectly. Starting after -Xdock:icon= insert a double quote (“). and continue to the end of the path for that parameter which should be minecraft.icns and insert a double quote after it. Next insert a double quote after -Djava.library.path= and follow that to the end of the parameter path which should be the name of the natives folder we dealt with earlier and place a double quote there. While we’re here we also need to modify the path to that natives folder since we copied it up one level, so delete the version number folder in that path (versions/1.6.2/1.6.2-natives-1373766486290585000 the red bolded folder here in my case). Next we need to double quote the classpath (cp) parameter. For the path following the -cp insert a quote at the beginning of the path and go all the way to the last jar (1.6.2.jar for me) in that path parameter to add a ” to the end of it. Next surround the path specified for the –gameDir parameter and finally do the same for the –assetsDir parameter. In my case the final result is:
- Save the file by pressing ctrl-o <enter> and then exit with ctrl-x.
- Now you need to change permissions on your startup script to make it executable. Within terminal type
sudo chmod +x startup1.6.2.sh
- Now make sure your currently running Minecraft game is closed and we’ll try our startup script by typing
./startup1.6.2.shin the terminal window. You should see output similar to what you normally see in the development console of the launcher and the game should start up.
Some things to look for if it doesn’t work for you the first time. First make sure your path parameters are properly quoted. It may be helpful to open the startup script in a GUI text editor like TextWrangler so you can see the quoted parameters color coded. Second, make sure the path to the natives folder you copied is correct because if you happen to copy the folder at a different time then when you copy the running command they’ll be named differently since the natives folder gets created with a timestamped name every time the launcher runs the game.
Note that by using this startup script to play in offline mode it is possible, within the same LAN, to have one person launch a game then within the game options choose “Open to LAN” and have a second (or more) person on another computer launch via the startup script to join the multiplayer game hosted on the same LAN. Within the startup script there is a –username attribute which you can set to anything you want your in-game name to be when you are playing on a LAN based game.
In my next post I’ll show you how to add the startup script we created here as an app within Launchpad, the Applications folder, or on your dock. Also, if there is enough interest, I’ll show you how to make this work if you are on Java 7. If you have any problems, see any mistakes I’ve made, or have questions, give me some comments and I’ll respond as soon as I can. Thanks and happy mining…err crafting…err both.