Index Picture, left
Index Picture, right

Paul Spooner's Minecraft Scripting Story

Wherein you can see nifty pictures, and read some text too. It's minecraft! Yay!

The Code

Go to this page if you're interested in the code, so you too can modify your Minecraft save files.

Intro

So, I realized that there is no combined page for the scripts I've been writing for Minecraft. Here it is, a photojournal of the scripts I've written, a brief history, and links to the code (moved to its own page). All of these scripts are written in Python, and only work on Minecraft files.

The Story

Beginnings

Like many of you, I learned about Minecraft through a link from a blog (I think it was Three Panel Soul). After playing the creative version for a while, I just knew I needed to get the full game. After playing Minecraft for a while I was struck by the urge to write some procedural content creation tools.

The first script I wrote was a simple interface to edit .mclevel files. Although it didn't do much, it got me rolling with the nbt file format. Mostly, I changed all of one material type to another type, or searched for specific patterns in the level, and then modified those locations. At this point, it would have been easier to use Omen (which I did to test some of the implementations) but these first steps are important.

Next, I started on a script to convert Dwarf Fortress levels to Minecraft levels. After getting the initial framework set up, and nailing down conversion shapes and things, I decided to wait until the new version of Dwarf Fort is out, since he is changing the level format. Then I found out that Notch plans on doing the same thing, only integrating it into the game itself, so the effort was put on hold. The hard work was not in vain, however, since the architecture I had developed for 3x3x3 blocks would come in handy for my first major script.

Castles

Castles! Since I first began experimenting with 3d modeling, and especially 3d scripting, I had wanted to program an automated method of generating castles. Now, with the Dwarf Fortress idea in my mind, and a simple and robust engine, I had the opportunity. In a few days I had the basic version running, which made decently lousy castles and towers.

Over the course of a few weeks, I gradually upgraded the code to allow multiple levels, an offset keep, doors, gatehouses, and towers along the walls.

Merging Maps

During this whole process, I was becoming familiar with the Minecraft forums and the mapping community. One need I saw was that several people were trying to join two maps together, and I thought to myself, "I could do that!" With what I had learned from experimenting, I crafted a simple quick script that would weld two levels together on edge, stacked, or fused via various means.

Trees

While developing the code for making castles, another thought had been growing in my mind. With the encouragement of a few forum members, and about a week of planning and experimentation, Forester was born.

This is by far my most popular script. So popular in fact that Notch (the creator of Minecraft) has incorporated parts of it into the latest version of the game. It was also the most difficult to execute, requiring several weeks of focused effort. Currently, it creates seven different kinds of trees which include branches and roots. There has been some dissatisfaction with the "new trees" in Minecraft. Overall I like them much better than the old tiny trees, but that could just be a creator's love speaking. Regardless of taste, it has about five times more downloads than any of my other scripts, so obviously someone likes it!

City Groundwork

After Forester was largely completed I worked on the castle script a bit more, and then did a small script to create city infrastructure. The plan was to lay down roads and then let people make their own city.

However, it quickly ballooned into a full on project. Currently, it makes roads, lights, sewers, utility lines (which carry water and lava) and a subway system. It can also make basic block buildings, allowing you to carve your own structures out of them.

Perhaps in the future, this script will develop into a full-on city generator. For now, it's merely a neat utility.

Basic Craters

In the middle of developing Groundwork, I recieved a message from one of the forum-goers. He asked (as a joke, I think)if my next script would be boulders and meteors. I liked the idea, and threw together a script to create just that, and called it StarStone.

I'd like to add a ridge around the craters at some point... but not today.

Working with Notch

It was around this point that I began working with Notch to integrate the Forrester trees into Minecraft. It involved learning Java and a good bit of testing, so my scripting slacked off. I did a short script that had been on my mind for a while to increase the height of levels. I called it Altitude, which seemed appropriate. When the tree upgrade was finished, I began fiddling with some other experiments. These are currently in the highly experimental stage. I had hoped to write more code for Minecraft, but Notch stopped responding to my e-mails when Minecraft's popularity took off. Still, I was paid the promised amount ($500 US) and got my name in the minecraft credits, so I can't really complain.

Miscellaneous Test Scripts

First was a script to make little huts.

And then a script to make coral reefs.

Beta and the New StarStone

After a long break (nearly a year) I wrote a new and much more robust interface module to read and write the new Beta format minecraft files. At this point I added a few features to the Forester script, and finally got around to adding material displacement to StarStone craters! This is before:

And this is after!

Flying Mountains and Upgrades

While working on the updated version of the castle script, I developed a land following system, and decided to turn it into a floating mountain rip up from the groundy thingy. Pictures do better justice than words in this case.

And, of course, combining Forester with WizardMountain has a certain appeal as well.

I went back to work on Forester at this point, adding hollow trees, and trees broken off at the top. Fixed a few bugs on the way that had crept into the program. I added re-lighting support to Forester and StarStone, and then did another upgrade to StarStone, allowing stuff like this.

Intra-mincraftinental Railroad

Around this time, Notch came out with the powered minecart track, and I finally got around to making a simple railroad script. It lays straight lines of rails, with periodic powered rail boosters, with tunnels and supports, as you can see below.

Integration with MCEdit

Around this time Codewarrior made a branch of Forester to allow it to work as a "filter" in MCEdit. I thought this was a great idea, and worked with him to provide native support of a filter wrapper in the Forester script. Once the wrapper was done, I expanded to include StarStone. Here's a picture of the internal GUI. Thanks again to Codewarrior for writing MCEdit and going through the trouble of porting the script in the first place!

Closing Remarks

The scripts are all available to download for free. If you'd like to make your own based on the code, go right ahead.

And that's the end of my story... for now! I'm still dabbling with developing more Minecraft scripts, and Minecraft is still in development itself. If you have any suggestions for new scripts (I don't do mods yet because of the lack of official mod support, sorry) contact me on X and I'll do my best!

Back to the Photojournal page.