Being
the better half of one of the best Java Evangelist out
there, many times people had asked me how much Java I know and I have always
joked that I am holding my data warehouse fort until recently when we started
talking about Java being one of the must
have skills for Hadoop and Big Data efforts in my organization @ Intel. I
started brushing up my Java skills and things got interesting when my husband
and 10 yr old son started planning for a kids workshop for teaching Java using
Minecraft at the same time.
For
those who don't know...Minecraft is
a very popular game among gamers, is written in Java and has a trial version
which can run as an applet in a browser or can be downloaded as a JAR file for
the desktop. The interesting part is that it allows the players to create
modifications (or mods as they are generally called) to alter the game as per their
choice and have more control over the game. My son has been playing it for
around a year and few months’ back he got interested in creating his own mods.
He started discussing the game with his dad who in turn started teaching him basic
programming concepts using Java. As they played around and made some mods
themselves, they thought of sharing the knowledge with my son's Minecrafter
friends. Trying to get a better hang of Minecraft, I got equally interested in
their discussions.
We
invited 10 kids of age range 10-14 yrs old. Both kids and parents were equally
excited and looking forward to attend the workshop. As we planned the material,
the challenge was how to explain Java programming concepts using real life
examples making it simple for kids to understand. We used cars, its
features, capabilities & types, and car dealers to explain the concepts of
a class, its properties, methods & instances, and packages. Fruits and
different methods of peeling, eating, and planting were used to introduce the
concept of Interface in Java and what can be done with the fruits was used to
explain the concept of Exceptions in Java. The kids built and executed their
first Hello World Java application using NetBeans.
We
had a five hour session where the kids created an entire framework for making a
mod. Minecraft consists of a client and a server. Multiple mods can run on the
server at a time but there is no official API available to create these mods.
There are many third-party vendor APIs like Bukkit that one can
use to create their own mod. For the workshop, we used Maven archetype to
create a template java project and avoided hand coding the complex code. The plugin (as called in Bukkit term) or
mod (as known in Minecraft) allowed the attendees to create a new
server-side command and printed a trivial message. Kids could open this mod as any other java
project in NetBeans and made further modifications to add more functionality to
the mod.
Both
kids and parent volunteers had total blast and they thoroughly enjoyed their
first experience with programming. If you are interested or know someone who might be interested, all the
instructions followed in the workshop are available at java4kids.java.net/minecraft-workshop.