Start Minecraft 1.6.2 in offline mode on osx

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:

  1. 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.
  2. 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.
  3. 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:
  4. 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.
  5. 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:
  6. Save the file by pressing ctrl-o <enter> and then exit with ctrl-x.
  7. Now you need to change permissions on your startup script to make it executable. Within terminal type sudo chmod +x startup1.6.2.sh
  8. Now make sure your currently running Minecraft game is closed and we’ll try our startup script by typing ./startup1.6.2.sh in 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.

About: geek

A software engineer that started at CompuServe back in 1995 and is going strong helping develop the web still today.


5 thoughts on “Start Minecraft 1.6.2 in offline mode on osx”

  1. I created this script, it requires you to create a folder named offline in your mine craft folder, and copy the natives there into folders named like 1.6.2-natives, etc. If you have created any custom or modes versions, they can share the same natives folder with the base version, provided you follow the naming convention like for them of #.#.#-custom_name, example 1.5.2-more_creatures. Once you copy the natives to the offline folders in the path /Users/your_login_id/Library/Application Support/minecraft/offline/#.#.#-natives, copy this script into a folder in your “PATH” like /usr/bin using sudo, and set in to executable using sudo chmod 755 /usr/bin/mc-offline (for example).
    Run it from a terminal window and it should ask you what user name to use and which minecraft version to launch. I apologize for the lack of detail in these instructions. I hope the script will be useful…

    #!/bin/sh
    
    clear
    gamedir=.
    assets=assets
    echo "Enter user name or just enter for 'OffLine': \c"
    read username
    if [ -z "$username" ]
    then
    	username=OffLine
    fi
    echo "Welcome to the OS X offline launcher \"$username\"!"
    cd ~
    cd "Library/Application Support/minecraft"
    count=0
    for ver in `find versions -name '*.jar' | cut -d / -f2`
    do
    	count=`expr $count + 1`
    	echo "$count) $ver"
    	verstring[$count]="$ver"
    done
    vernum=0
    while [ $vernum -lt 1 -o $vernum -gt $count ]
    do
    	echo "Enter the number next to the version to run: \c"
    	read vernum
    	vernum=`echo 0$vernum | tr -C -d '0123456789'`
    	vernum=`expr $vernum + 0`
    done
    version="${verstring[$vernum]}"
    base=`echo "$version" | sed 's/-.*$//'`
    launchtype=`echo "$base" | sed 's/\.[0-9]$//'`
    if [ "$launchtype" = "1.6" ]
    then
    	java -Xdock:icon="assets/icons/minecraft.icns" -Xdock:name=Minecraft -Xmx1G -Djava.library.path="offline/$base-natives" -cp "libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar:libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar:libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar:libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar:libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar:libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar:libraries/argo/argo/2.25_fixed/argo-2.25_fixed.jar:libraries/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar:libraries/com/google/guava/guava/14.0/guava-14.0.jar:libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar:libraries/commons-io/commons-io/2.4/commons-io-2.4.jar:libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar:libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar:libraries/com/google/code/gson/gson/2.2.2/gson-2.2.2.jar:libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar:libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar:versions/$version/$version.jar" net.minecraft.client.main.Main --gameDir "$gamedir" --assetsDir "$assets" --version "$version" --username "$username"
    else
    	java -Xdock:icon="assets/icons/minecraft.icns" -Xdock:name="Minecraft" -Xmx1G -Djava.library.path="offline/$base-natives" -cp "libraries/net/minecraft/launchwrapper/1.3/launchwrapper-1.3.jar:libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar:libraries/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar:libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar:libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar:libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar:libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar:versions/$version/$version.jar" net.minecraft.launchwrapper.Launch "$username" token: --gameDir "$gamedir" --assetsDir "$assets"
    fi
    
    1. Nice work Barry. I was thinking of doing something similar, but didn’t get the time yet. This will save me some time:)

  2. This still sort of works for 1.6.4 but it now exits when trying to connect to multiplayer games over the internet. Open to LAN still works though.

  3. Awesome! Thank you for this. We have three of us playing together on our macs with the server running on Windows.
    Does anyone know of a way to get the Windows client to run offline?

Leave a Reply to Barry Nelson Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.