Skip to main content

Get your Kiddos Programming with Minecraft, Python and the Raspberry Pi

Ever heard of Minecraft? It is ALL the rage with the youth of today. My boys discovered the game while playing with a Raspberry Pi about three years ago and they were hooked. Who would've thought with all the advances in graphics displays, it would be the 8-bit-ish block building game that would capture my children's imagination so completely?

Knowing our love of the game, the talented and lovely Angela Sheehan gave me a book titled Learn to Program with Minecraft. I gave it to my boys, fully expecting to see it sitting dusty on a shelf. I was SO wrong.

They read it in the bathroom. They read it LONG after their "lights out" bedtime. A month or so ago, they woke me up at 5 a.m. hurling Python commands at each other. I hadn't paid much attention until the 5 a.m. wakeup call, but this gave me pause: my nine-year-old children are coding. Even better, they taught themselves and they're having a blast doing it. Wanna get your kiddos into programming? This is the way to do it.

image of minecraft book and screen and keyboard next to it
My current setup includes the TouchScreen, SmartPi Touch Case, and the Wireless Keyboard. Look how fancy!

The Raspberry Pi is almost plug-and-play. If you have an old monitor, keyboard and mouse lying around, you can get the Noobs card and it will walk you through the steps of getting your Pi's operating system set up. Minecraft comes with Raspbian, which is the operating system you'll install. We have some great tutorials on getting set up with the Raspberry Pi - check out the How to Use Remote Desktop on the Raspberry Pi with VNC tutorial and/or the Headless Raspberry Pi Setup.

The "Learn to Program with Minecraft" book also has step-by-step instructions for getting your Windows/Mac/Raspberry Pi set up. The first couple chapters of this book get you up to speed and coding almost right away. One of the first things you do in this game is create a house, especially if you're playing in Survival Mode (the Pi version is Creative Mode) - because once night falls in Minecraft, the creepers come out and they can GET you. Chapter one gets you set up to play, and chapter two teaches you syntax, variables, and helps you create a quick structure with a script. Check it out...

image of basic house
Click the image for a closer view

It doesn't look like much, but it is the basis for a whole world of opportunity. Go a little further with that basic script and you've got a CASTLE. With moats! And turrets! Check out Matt Hawkins' post here that provides a script to build yourself a castle.

Image of Castle
Click the image for a closer view

Here's a bit of the Python code that built this castle. It looks intense, but most of this type of thing is covered in the book. Also - LOTS of comments. So great.

A bit of the python code to build a castle

I love the reference material, as well as the way coding is explained - straightforward, colorful and fun. Aside from a few "how do you say this" and "what does this mean" questions, the kids were able to follow along no problem.

Block ID cheat appendix
while-else statements and a game

This is just the tip of the iceberg. As my kiddos like to tell me, what you can build in Minecraft is really only limited by your imagination and the amount of time your parents allow you to play. I like that they are being creative AND learning to code at the same time. Win-win.

Do you have a Pi? How do you get your littles coding? Let us know!

comments | comment feed

from SparkFun: Commerce Blog


Popular posts from this blog

TE Connectivity Announced Ultra Small Spring Fingers

TE Connectivity (TE)’snew ultra small spring fingers have one of the smallest footprints in the market to save valuable PCB space, allowing for use in a broad range of applications with space constraints across various industries.TE’s ultra small spring fingerscan save valuable PCB space with one of the smallest footprints in the market. Closed-loop contact design ensures reliable connection to the PCB, better normal force and higher current capacity (1.5A). Robust side wall minimizes over- compression. Special anti-lifting design can improve assembly e ciency by locking the tip of the contact within the sidewall of the spring  nger, which helps prevent the contact from getting caught on an operator’s glove during assembly. Pick-and-place area supports auto-assembly processes. It also offered in different heights and styles.As an authorized distributor for TE Connectivity, Heilind Asia provides TE’s products and also value added services. Heilind Asia supports both original equipment …

Hanwha TechwinCollects Two NPI Awards for Its Cutting-Edge Modular Mounter and Screen Printer at APEX

Hanwha Techwin Automation Americas, formerly Samsung C&T Automation, today announced that it has received two 2019 NPI Awards in the categories of Component Placement – High-Speed for its HM520 Cutting-Edge Modular Mounter and Screen/Stencil Printing for the ESE US-2000XF. The awards were presented to the company during a Tuesday, Jan. 29, 2019 ceremony that took place at the San Diego Convention Center during the IPC APEX EXPO.With the HM520 Modular Mounter, actual productivity is highest among machines of the same class and is optimized to high quality production. The system configures a flexible production line by applying a modular head and various production modes. The HM520 realizes unmanned, non-stop, and zero-defect production using the Smart Factory S/W Solution.The high performance HM520 offers a compact foot print, auto-calibrating maintenance free feeders, and modular heads. The HS(High Speed) Head offers a 20 Spindle x 2 Gantry, 80,000 CPH, ±25 μm @ Cpk ≥ 1.0, 0201 ~ …

Battery Stack Monitor Maximizes Performance of Li-Ion Batteries in Hybrid and Electric Vehicles

Cosimo CarrieroField Applications Engineer, Analog Devices, Inc.AbstractLithium-ion (Li-Ion) batteries are a popular way to store energy in electric and hybrid vehicles. These batteries offer the highest energy density of any current battery technology, but to maximize performance, a battery monitoring system (BMS) is mandatory. A state-of-the-art BMS not only allows you to extract the highest quantity of charge from your battery pack, but also lets you manage the charge and discharge cycles in a safer way, which results in an extended life. Analog Devices provides a full portfolio of BMS devices with focus on accuracy and robust operation.Accurately measuring a battery’s state of charge (SOC) increases battery run time or decreases weight. A precise and stable device does not require factory calibration after PCB assembly. Stability over time improves safety and avoids warranty problems. A self-diagnostics feature helps reach the right automotive safety integrity level (ASIL). A batt…