Friday, August 18, 2017

Using Minecraft Modding to teach Java Programming

For the past three years I have run a week-long Minecraft summer camp, where students engage in collaborative creating & building in the Minecraft game and through hands-on STEAM related challenges. This year, I decided to take it a step further to use Minecraft modding to teach Java programming.

The only problem was, I knew nothing about Minecraft modding or Java!
But, fortunately, that doesn't need to stop you!

In my previous Minecraft camps, we often connected a challenge in the game to a hands-on build challenge.

Campers design structures to withstand a Mentos & Diet Coke volcano

For example, students may build a tower together in the game, and be challenged in groups to complete the marshmallow tower challenge. They may have to build a bridge to carry sheep across a river or lava field, and also create a bridge out of tooth picks and gum drops. One of my favorites was when they crafted defenses around a village in the game to protect from a volcano, and then built their own real world structures out of Magic Nuddles to withstand a Mentos & Diet Coke volcano. Through these experiences we focused on the engineering design model and on creativity & collaboration. I used the educational version of the game, Minecraftedu, which allowed me to host my own server and provided me with additional teacher controls.

Campers making perler bead Minecraft art
Campers collaborating on a newspaper fort

This year I decided to take it a step further, and offer an additional camp that would use Minecraft to teach coding. Each year my summer campers asked if we could play Minecraft as a group with "mods." Mods, short for modifications, are changes to the original gameplay. Mods are created by "modders", who code their alterations to the game in Java (the program Minecraft is written in). MinecraftEdu is in itself a modified version of the game, which gives the teacher controls like the ability to freeze or teleport students. While we didn't run different mods at the students' requests, it gave me the idea of running a separate Minecraft modding camp which would teach students how to code their own mods in Java.

 I set off to make a Minecraft modding camp a reality. The only problem being that:
1. I didn't know anything about modding
2. I haven't progressed in coding much beyond drag-and-drop programming

After searching online for solutions to these two problems, I stumbled across Code Kingdoms. What I found seemed too good to be true. They basically offered a service for the exact camp I was hoping to run. Their platform teaches students to code their own Minecraft mods in Java using a drag-and-drop format. Teachers do not need to be experts, and can act more as facilitators, as they offer extensive video tutorials for tiered modding challenges. Inviting your friends to try out your mod in your own server is also made super easy.

The Code Kingdoms Homepage (8/2017)

I sent them an inquiry email, and heard back shortly after. Soon I was video conferencing with representatives, learning about their service and how I could make this Minecraft modding summer camp a reality. Although it is a paid service, I was set up with a free account to explore the courses offered and learn more about the product. It didn't take long to settle on Code Kingdoms for my camp. The per-camper account fees were also reasonable. I ended up settling on a plan for one week-long credit per student. (As of last week, this plan is no longer offered but the new packages also seem reasonable.) Over the next few months before my 2017 summer "Minecraft Modding with Java" camp would begin, I explored the course offerings from Code Kingdoms to familiarize myself with modding in Java.

Courses are tiered by age level

The modding courses were a little intimidating at first, as most take 2-4 hours to complete. However, the steps are broken down into entertaining 15 minute videos, and the code editor provides instant feedback on whether you are coding it correctly. You can also try out your mod in progress before completing it, so you do not need to wait 4 hours to play your mod in Minecraft. Even though it is drag-and-drop coding, the code editor does allow you to see what your code would look like if you wrote it out entirely yourself. This helped me understand what programming in Java actually looks like.

A screen shot of the "Hungry Games" mod being written with drag-and-drop blocks

The same code as above, viewed in Java without the graphical drag-and-drop blocks

Many of the courses teach students how to create popular mods that are already out there, such as "Hungry Games", a player vs player mod based on the battle arena in the Hunger Games book. On a few occasions, I messed up on my code and became quite frustrated. The code editor alerts you to the location of the bad code and tells you what is wrong, but it doesn't exactly provide enough information to guarantee a novice can fix it. However, going back and watching the video tutorials more carefully and viewing provided hints always helped me solve the problem. That and taking a few minutes away from the computer to regain my thoughts!

I was a little worried that my campers would also become frustrated by how long the mods took to program, but I was relieved to discover the "Course Extensions" page. This section provided quick little mods that typically take 5 minutes to code.  Here, students would be able to test out and play their mod with friends after minutes instead of after hours of coding. Some course extension mods included alterations to the game like enabling a character to teleport, cast lightning, or assign player specific mods. My campers range from grades 3-6, so the organization of courses by age level was also helpful.

Campers are watching a modding tutorial and discussing it as a class before attempting on their own
During our 5 day Minecraft Modding camp, I would begin our lesson with whole-group modding challenges. We watched a quick course extension mod video as a class, and discussed the coding principals involved. Concepts introduced and reviewed included those such as booleans, methods, strings, and conditionals. Having taught Scratch coding to students and campers before, this felt very familiar. Campers then tried the quick mod on their own, and were encouraged to add their own changes. When complete, they invited friends to play out their mods in their server. After these introductions, some students went on to tackle the 2-4 hour long modding courses, while others stuck mainly to coding the quick course extension mods. Some campers spent more time playing out their mods in the game, others spent more time coding. My co-instructor and I walked around and assisted and encouraged students as needed. By the end of the 5 days, I was thrilled to see how much the students had learned about coding their own mods in Java. Some campers even continued modding when they went home each day.

Campers are busy modding away!

After seeing how smoothly everything ran, and how much the campers loved learning Java to mod minecraft, I know I will continue to run this Minecraft Modding camp again in the future. After seeing how sad they were that the camp was over, I imagine I'll see many of the same campers again next year!

Notes about Set-Up
In the weeks leading up to the camp, I downloaded Minecraft on all of the computers in the lab, and quickly learned that the firewall needed to be adjusted. Since the Code Kingdoms mods only run on regular (or Vanilla) Minecraft and not MinecraftEdu, our firewall was blocking the game from opening. For those of you with the same problem, the solution was to have your district admin open outbound access to TCP port 25565. Since I could not use MinecraftEdu, I also had to make sure that my campers came with already having access to the  PC version of the game. This meant that their parents had to purchase a Mojang account for them online prior to the camp beginning ($26.95). If the campers did not have their own Mojang account, they would not be able to test out and play the mod they wrote on the Code Kingdoms website. You can download the game on the computers without buying it, but into order to actually open the file and play the game, you need to sign in with your Mojang account. Lastly, I realized that with all of the video tutorials running simultaneously in the computer lab, it would be best to encourage all students to bring their own headphones.

While I continue to run my traditional Minecraft camp as in the past, I have not yet navigated to the updated MinecraftEdu (after its purchase by Microsoft). This is because my students do not have the necessary Office Student accounts (we are a Google Apps for Edu school). Eventually I may need to find a way to do this as the pre-Microsoft MinecratEdu version becomes obsolete.

If you have any questions about my experience, please comment below!

No comments:

Post a Comment