RPi Minecraft + Networking

In this activity students will learn about networking on the Raspberry Pi using a popular pre installed game called Minecraft.

I use this opportunity to speak about the human networking that happens when a team of individuals work together. Minecraft is known as a sandbox game where blocks can be created or destroyed.   Many students have played Minecraft in a way that players attack each other known as player vs player, or PVP. Establish that this is not the kind of environment that is being created.  Students will work together to build something cool.

Establishing a level of experience with Minecraft is a good way to start.  I like to group advanced users with each other and beginning users together.  Each group needs to brainstorm, plan and build something in a specified amount of time.  I usually give students between 15 and 30 minutes and encourage them to stretch to collaborate.   Groups can range in size from 2 – 5 players.  One student will “host” the world on their device and will need to identify their I.P address to share with partner players.

Immediately upon opening up Minecraft students given an option to join game or create a new world.  If they create a world, it exists on their pi, if they join a world they need to know who’s world they are joining.  This becomes a process of students calling out and identifying who’s pi is at which IP address.  The IP address can be found by hovering over the Wifi signal in the upper right corner of the screen.

Students who have never used Minecraft will need assistance learning to move within the world, to place a block and to change their inventory.  These students should focus on building something very simple.  Advanced students might build a castle or a huge underground maze.  At the end of the build time, join into the world on your Pi and let one of the students from each group share what they created.

If students wish to save the world they are working on, they will need to navigate to the .minecraft folder from and drill down to the folder of the world they were playing in.  The following video goes over how to do this.

RPi Sense HAT+Minecraft

The Sense HAT was developed by the folks at Raspberry Pi as an add on board that contains a number of sensors and a LED display. In this lesson we can demonstrate how to use the Sense HAT in conjunction with Minecraft to visualize real world data and control the LED Screen.

I use this lesson primarily to get students excited about the connection between a sensor and the way that we can visualize data through Minecraft.  This worksheet from the folks at the Raspberry Pi foundation is an excellent resource. In the latter portions of the lesson it goes into methods of collecting data from the Sense HAT and displaying it within the Minecraft world.

https://www.raspberrypi.org/learning/exploring-space-with-minecraft/

Follow along with the Sense HAT installation and the first several worksheets of this project.

4. Github Intro

Github is known as a repository for cool programs that can be used in all sorts of ways on your Pi. In this lesson we will learn how to install programs from Github using the terminal.

First lets install a program that can do screen captures. Something that is handy when students have created something amazing in their Minecraft world.

Lets follow the instructions for taking screenshots provided by Martin O’Hanlon.

http://www.stuffaboutcode.com/2016/03/raspberry-pi-take-screenshot-of.html

Here is a video going through the process.

Students will be really excited when they learn to download programs that can run within their Minecraft world. Lets go back to Martin’s API tutorial and have students select one of the first three items, clock, cannon, or snake video game.

http://www.stuffaboutcode.com/2013/04/minecraft-pi-edition-api-tutorial.html

In each of these examples, there is a section of code that should be copied into the terminal. When enter is pressed on the keyboard, a bunch of code will appear and a new program file will be placed in the home directory on the Pi

Have students navigate to the file folder and open the file with the .py extension by right clicking on the file and selecting open with python 2 from the drop down menu.  If the program is run while Minecraft is open it will place an exciting new feature in the Minecraft world. This will hopefully trigger a desire to try downloading other python programs to modify their Minecraft worlds.