twitter linkedin

Minecraft Map Viewer

17 Oct

I have to admit, I’m a big fan of Minecraft for a while now, and I love the way the creators, Markus and Jens, are very open about working on this game. When Minecraft 1.3 came out it had a new way of saving the huge and worlds. If you take a quick look at the wiki you’ll notice that there’s a lot of information for developers to work with the Minecraft data format. I was very curious about what I could do with the level data. A few weeks ago I created a small tool in Java that works with the level format, and learned quite a lot about the way Minecraft stores the world.

But since I love to work with ActionScript, I was wondering if I could do something with the level files in Flash or Air. I thought that with the ByteArray and BitmapData class available, I should be able to do fun things. So I started working on a simple map renderer. As far as I know, Flash doesn’t support reading directories, so I Air was my platform of choise.

I ported the JNBT library to ActionScript to read the binary format of the ‘chunks’ (16 x 16 x 128 blocks) that Minecraft uses to store the world in. The rest of the code is rather quick and dirty. Pretty much everything was hardcoded into a few loops to render the blocks to individual BitmapData objects. This is the result:

Minecraft Map Viewer

If you want to give it a spin, you can download the .air file here!

Edit: I got a few requests for the sourcecode. So with no further ado: here it is! You’ll need to compileMapRendererMain as an Air application. Included is my ActionScript port of the JNBT library, found in org.asnbt. You can use this library to read and write NBT files. The most important classes besides the JNBT library are the ‘SimpleRegionFile’ class and the ‘RegionBitmapData’ class. Feel free to fool around and let me know what you think!

Edit 2: There was an update to the world format a few weeks ago, making this tool useless. Only MCRegion worlds are supported. the AS3 NBT classes still work though!

8 Responses to Minecraft Map Viewer

  1. Ryan Guill says:

    this is awesome! any chance you will release the code?

    • joranderaaff says:

      I’m not sure what the license is of the JNBT project. If the license permits it, I can release the source code. I will take a look at this when I’ve got the time!
      Edit: JNBT has a BSD license. So I should be able to release the ActionScript port, right? (I’m not really familiar with all the licenses)

    • FirstLucile says:

      I have noticed you don’t monetize your page, don’t
      waste your traffic, you can earn additional bucks every month because you’ve
      got high quality content. If you want to know how to make extra money, search for: Boorfe’s tips best adsense alternative

  2. Ryan Guill says:

    Yeah, I think BSD is pretty permissive, you can even use it in proprietary software I think.

  3. Pingback: Cool Stuff with the Flash Platform - 10/24/2011 | Remote Synthesis

  4. shane says:

    hey just wondering how i get this to work i dl it and installed it. but when i open it i dunno what to do. i tried opening my save file but i get nothing. pls help.

    • joranderaaff says:

      Hi shane, sorry for the late reply. I think you might be using the new level format. I haven’t come around to implementing the new format just yet (and I don’t know if I will) but for now you can only MCRegion type levels.

Leave a Reply

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




Blog RSS