|Learn to Program with Minecraft Plugins
Author: Andy Hunt
Minecraft is a fun "game" and it already has aspects of programming within it so what could be more logical than using it to teach programming?
This is an undeniably good idea but there are some serious problems with it.
This is a really well written book and if it doesn't succeed then I doubt any book will, but it is important that you know what is expected of you before you launch into the challenge.
The first thing to say is that the subtitle: Create Flying Creepers and Flaming Cows in Java is encouraging and exciting and, yes, if you stay the course you will be into flying creepers, flaming cows and even Java. The problem is that it is a tough course, no matter how hard the book tries to make it easy. The reason is that working with Minecraft is technically difficult - something that perhaps experienced Minecraft users fail to recognize.
Let's start at the beginning which is what the book does in Chapter 1. This explains the idea of the command line and it does it really well. It covers Windows, Linux and OSX. As the actual need is to use a Linux style command line, Windows causes something of a problem, but the reader is advised to download and install BusyBox, which is a POSIX shell i.e. a Linux shell. You can see that things already aren't as simple as they might be, but now at least we are all working with the same tools.
The idea of the file system and simple commands to work with it are introduced next. The explanations are very gentle and go to great lengths to make it easy and understandable for the beginner. On page 4 we have:
DO NOT TYPE IN THE DOLLAR SIGN ($). I'll show it to indicate where you type, but you don't type the $.
If this warning has never occurred to you then you haven't tried to write something targeting the beginner. What to type and what not to type rapidly becomes so obvious that you quickly forget that there is any possible misunderstanding - there is.
The chapter continues on like this and at the end you will have managed to understand and use the command line. If you are a complete beginner then it probably feels like you just climbed Mount Everest. The depressing part is that at the end of the chapter it says
"Your toolbox is 2% full. You can now do the following:
Only 2%! It might send some beginners into a trough of depression but it happens to be true and good on the author for being brave enough to say it.
The problem is that taking the Minecraft approach means the reader has to master all sorts of things that have little to do with programming. It isn't possible to sit down and get on with learning Java because you have to learn how to setup a Minecraft server and work with it first. If you really, really want to create Minecraft plugins then it is worth the effort, but if you just want to learn Java it probably isn't.
Chapter 2 moves on to consider Java programming - getting an editor, installing Java, testing that the compiler is there and working and finally installing the Minecraft client and server. At the end of the chapter you will be relieved to hear that your toolbox is 7% full and you can now move on to some real programming.
Chapter 3 introduces the task of building a Minecraft plugin. Yes, its a "Hello World" plugin! Of course, this isn't so much about learning to program as learning how to put together the different components that make a plugin. All of the components needed are provided by the downloaded code - you don't actually write any Java. This really is about the only way you can get started in small steps. The big advantage is that the payoff is huge. After writing just a few lines of code you have a plugin that does amazing and impressive things and you had a hand in creating it.
Next we learn something about Java and the ideas of variables, functions and keywords is introduced. Another downloaded plugin now gives you a chance to try out the ideas and create a few variables. At the end of Chapter 4 we have encountered quite a lot of Java, including loops, conditionals and strings.
Chapter 5 introduces the idea of an object, goes over the reasons why you might want to do things this way and shows how to create a new object. This is more or less the end of the "pure" programming introductions. From this point on each of the chapters introduces a programming idea while developing the art of working with Minecraft plugins.
For example, Chapter 6 explains the structure of a Minecraft plugin. It explains how Minecraft knows about your plugin and the coordinate system in use. It is essentially about Minecraft rather than about Java - but of course you are going to learn something about Java as you go along.
The next two chapters introduce arrays and the Java HashMap, two basic data structures, by discussing how they are used in Minecraft. Next we have a detailed explanation of how to work with Minecraft blocks. This is where we encounter the flying creeper as promised in the subtitle.
From here things become increasing detailed and Minecraft-oriented - how to schedule tasks, using configuration files, storing data in local files and so on. Chapter 12 deals with the topic of using Git to keep your code safe using version control. Chapter 13 is a very general look at how to think up and create your own Minecraft plugin.
The book closes with seven appendices covering topics from reading error messages, to installing a cloud server.
This is a really well written book and I can't imagine a better introductory book on the same topic. If you want to learn how to create Minecraft plugins and learn Java on the way this is the place to start. At the end you will be able to create Minecraft plugins but your journey to learn Java will only just have begun - I'd say about 20%.
However, you need to be aware that if you are just interested in learning to program there are simpler and easier routes to follow than to dive into Minecraft and this always going to be true no matter how excellent an introductory book you find.
|Last Updated ( Monday, 25 August 2014 )