Making Minecraft 1.5 Pretty on Ubuntu Raring

I finally broke down and got Minecraft, even though I think Minetest is fairly excellent and getting better. Even though you pay Mojang for the game, making it polished takes at least a couple of mods and making it really slick takes a few more. I wrassled around with minecraft on Linux and found a decent set of bits which make the game pretty fancy. This guide assumes you've got minecraft successfully installed, but not too much else.

  1. Update Java

    I can run minecraft with the free and open JDK which ships with Ubuntu, but in order to use all the bells and whistles including updated lwjgl (2.9.1), I needed to install oracle's Java. I used webupd8 PPA, which is probably cheating but PPAs are much of the point of Ubuntu to my mind, why not use them? If you somehow don't have it, also install unzip at this time.

  2. Update lwjgl

    lwjgl is the lightweight java gl library, which is the route Mojang chose to handling graphics and input. The antiquated version shipped with Minecraft supports little visual nicety, and also causes various problems on amd64 platforms. The old version works with the openjdk, but the new version is required for the full power of Optifine. You can skip this step, but you won't get the same visual quality as if you don't, and you will probably have input problems on amd64.

    First make a copy of your original libraries. cd to $HOME/.minecraft/bin/natives and create a backup directory there. I made a directory called lwjgl-orig and moved *.so there (mv *.so lwjgl-orig) Now unzip lwjgl, for example unzip ~/Downloads/lwjgl-2.9.1.zip. If that's the version you're using (currently the latest, and required for best operation on 64-bit Ubuntu) then you'll want to follow that up with this:

    for i in lwjgl-2.9.1/native/linux/lib*
    do
    ln -sf $i
    done

    That will cause minecraft to load the updated version, but leaves it easy to switch back; just delete *.so from $HOME/.minecraft/bin/natives and copy *.so back from lwjgl-backup. Now, you're going to need to update two jar files in much the same way. cd .. (back to $HOME/.minecraft/bin and make another lwjgl-orig directory, then mv lwjgl*jar lwjgl-orig and finally for i in natives/lwjgl-2.9.1/jar/lwjgl{,_util}.jar ; do ln -sf $i; done. Now you've updated both the libraries and the java classes for lwjgl, and your minecraft will no longer work with the openjdk.

  3. Back up minecraft.jar and unpack into a directory

    Open a terminal and cd to .minecraft/bin. Copy minecraft.jar to a backup file, I like minecraft-version-backup.jar, which would currently be minecraft-1.5.2-backup.jar. If you mess up, you can copy this file back over the top of minecraft.jar. 1 Make a directory, for example moddir. cd into this directory. Unpack minecraft.jar with the jar command, like so: jar xf ../minecraft.jar. Now rm -rf META_INF/MOJANG*.2

  4. Apply patches and create new jar file

    Forge mod loader must be installed to the minecraft jar, as must OptiFine. I used FML 7.8.0.696 and OptiFine HD D2 Standard; you may wish to use the same versions, or you may wish to try newer versions if they exist. Install them in that order by unzipping FML and then OptiFine in the moddir and overwriting files if prompted. Now use jar again to create a new jar file in place with jar cf ../minecraft.jar. Once you've tested your jar and it works you can copy it to a backup file for later use, for example named minecraft-1.5.2-modded.jar.

  5. Running minecraft

    If these steps haven't worked then there's no point in proceeding. Short, short, short form, this is the command line I'm using for minecraft with sun java 7 on Ubuntu Raring x64:

    java -Xmx1024M -Xms512M -XX:+UseFastAccessorMethods -XX:+AggressiveOpts          -XX:+DisableExplicitGC -XX:+UseAdaptiveGCBoundary          -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=16 -XX:UseSSE=4 -XX:+UseParallelGC -XX:ParallelGCThreads=6 -jar /opt/games/minecraft/minecraft.jar

    /opt/games/minecraft/minecraft.jar is where I keep the launcher jar. I have a six-core processor and I wrote a very simple shell script (attached, see below) which produces the command line. It Works Here(tm). But you can simply use the above, pointing to your launcher jar file, the first one you downloaded from Mojang which downloads the other one from Mojang and puts it in your $HOME/.minecraft directory. I was too lazy to automate sse version detection (contrib regexps will be accepted for cpuinfo from proc) so you have to set sse version in the script.

    If you can log into minecraft, or if offline at least get the program fully loaded, then you're ready to finish up before generating a new world.

  6. Add Mods

    MAtmos improves Minecraft's environmental sounds. cd to $HOME/.minecraft and unzip its archive there, not in mods or any other subdirectory. Millenaire adds cultures to the game that you can trade with or even eventually lead, with their own unique villages and structures. cd to $HOME/.minecraft/mods and unzip it, then for example mv "Mill*naire 4.9.4/Put in mods folder/*" . (note that trailing dot, and the version number) and then you can rm -r "Mill*naire 4.9.4". DungeonPack adds many interesting dungeons to Minecraft, with mobs and treasure. Just copy the zip to $HOME/.minecraft/mods. You can omit any of these mods if you're not interested in them.

  7. Texture Pack

    If you have a high-resolution display and a decent video card, you will doubtless want some higher-resolution textures. I used Misa's Realistic Texture Pack. FML will handle HD texture packs so you can forget all the installation instructions except the last one: copy/save the zip to $HOME/.minecraft/texturepacks and you will be able to select it from within minecraft. There will be a delay after selecting it while the texture pack is processed, and you can watch the process from a terminal window where you launch minecraft.

These mods give a nice appearance and add some well-designed features to the game, giving you something to do in between world creation and the end game. Anyone with a fairly modern computer will want at least Optifine, for which you need a modloader; the best one these days is forge. Once you've got forge, you can load other mods, so why not?

These instructions should work on Windows as well, though the minecraft directory is in another location — %appdata%/.minecraft/ (or <code>/Username)/Library/Application Support/minecraft on OSX.) Most Windows users simply open up the jar file in an archive editor (jar files are just zip files) and drag and drop, and you can try doing that on Linux as well but not only did it not work for me, it's just not as fast. You'll need to repeat this process every time minecraft is updated, so you might as well get comfortable with it now. Every so often someone brings out a graphic tool which patches minecraft, and they are typically outdated before too long and then you're either looking for another tool, or you'll be looking for these directions again. :)

  • 1. If you don't have a backup, you have to delete minecraft.jar and redownload it, which is bad for everyone.
  • 2. I had signature errors with forge which I "fixed" by deleting META_INF/* from my moddir before creating the new jar.
File attachments: 

Add new comment

Default

  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You may link to images on this site using a special syntax
  • Web page addresses and e-mail addresses turn into links automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Filtered words will be replaced with the filtered version of the word.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <q>

Issue

  • Lines and paragraphs break automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>

Drinking Game

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <br> <pre> <h2> <h3> <h4>
  • Images may be embedded like: [image:node_id align=alignment hspace=n vspace=n border=n size=label width=n height=n nolink=(0|1) class=name style=style-data node=id] Leave off any attributes you don't want.
  • [img_assist|...] tags will be displayed, maybe. Please don't make more of them.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.