Minecraft’s Happy Accidents of Programming

It fills me with hope whenever I think back on how Notch, even after Minecraft becoming a huge success, still had much to discover in the realm of programming and design.

Apparently, the foundation of Minecraft was developed in a week of frantic coding. From there it was years of growth and updates that made it into the widely popular game that would eventually be sold to Microsoft for astronomical sums of money.

Yet, well into the post-release development of Minecraft, Notch was still learning about how classes work. In a weekend of coding, he decided to add logic that would cause passive mobs to flee from players when attacked. This would make hunting for food all the more exciting. The result, however, was even more interesting than Notch had expected. Due to how the classes for passive mobs were set up, they not only ran from players when attacked but also from hostile mobs – such as wolves. This was a happy little accident that added an extra sense of depth and life to the world. It appeared that wolves would hunt sheep and the like. Nifty!

Minecraft Wolf
Wolf kills sheep and leaves behind wool.

But this is merely a side effect of how classes work. I can’t find a source to back this claim up, but I swear many years ago I read about Notch being excited to discover classes and implement them in Minecraft. To think that Notch had developed an extremely popular and profitable game without using classes (whether he was familiar with them or not) is incredible. Which is why it gives me hope that a good game can come from questionable code.

Back to doing some further testing. I was exploring a forest biome, hit upon a river cutting through it, and walked over a small hill. On the other side, a wolf was chasing a sheep, but the sheep was running away. I didn’t have this in mind when I wrote the code to make mobs flee, but it ended up giving me an unexpected experience of having some kind of echo system of competing behaviors in various animals, and it just felt.. nice. It made me realize we should explore more mob to mob interactions, and have more chaotic competing behavior. – You know what’s fun?





Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s