Hour of Code has become a worldwide effort to celebrate computer science, starting with 1-hour coding activities. So today we're going to share some fun Hour of Code Minecraft activities you can complete, as you learn Minecraft programming. We'll guide you step by step through the challenges in the Minecraft demo world: Minecraft AI for Good.
If you're a teacher looking to lead an Hour of Code session, please get in touch here. We'd love to help you.
Hour of Code Minecraft activities FAQs
How do you get an hour of code on Minecraft: Education Edition?
To get an hour of code on Minecraft: Education Edition, install Minecraft: Education Edition on your computer. You can download Minecraft: Education Edition here.
To play the Hour of Code 2019 demo world, you’ll need to have Minecraft: Education Edition installed on your computer. After you have installed Minecraft: Education Edition and launched it, the game might automatically open a second window prompting you to log in. If this occurs, you can simply close the log-in window.
You should see text that says “Welcome to Minecraft: Education Edition” and a large “Sign In” button. To access demo mode, click the text that says “If you don’t have an account, try a demo lesson.” Check the “Accept Terms” box and click “Play” to enter demo mode. Click “Start Lesson,” then “Hour of Code 2019 (AI),” and finally “Create World” to begin the lesson.
What is Hour of Code?
Hour of Code, created by Code.org, started as a one-hour introduction to computer science, designed to demystify "code", to show that anybody can learn the basics, and to broaden participation in the field of computer science.
In the Hour of Code 2019 world, you will be faced with a series of coding challenges to help you become familiar with the coding environment in Minecraft: Education Edition. If you need a reminder on how to use the controls in Minecraft, press H on your keyboard to show/hide a list of keys/buttons and their functions. To begin a challenge, talk to the non-player character (NPC) offering the challenge to understand your goal. Once you’ve read what the NPC has to say, close the dialogue window and then press C to open CodeBuilder.
Enjoy Hour of Code Minecraft activities
Let's get started exploring the challenging activities in the Hour of Code 2019 demo world. Or you can jump right into the best Minecraft coding classes for kids for a fun hour-long Minecraft activity.
1. Researcher - Open the Gate
The first challenge, in which your goal is to enter the research facility by opening the gate, teaches you how to put code blocks together in CodeBuilder. The “on start” block is where you will add code blocks that will cause something to happen in the world. Once you’ve put together the code you need to open the gate, press the green Play button in the lower right corner to run your code. If you need a hint on how to complete the code, the light bulb icon in the upper right corner of the CodeBuilder window can provide you with useful information. If you still can’t figure out the solution, you can talk to Helper Bot. The light bulb icon and Helper Bot will be available on all coding challenges.
2. Engineer - Meet the Agent
The second challenge introduces you to the Agent, a special Minecraft entity that responds to the commands you give it via your code. The goal in this challenge is to make the Agent move onto the target block next to the NPC. Just like before, press the Play button to run your code when you are ready.
3. Researcher - Agent Analyze
The third challenge is to make the Agent analyze a dried up plant so that it can learn about what constitutes a fire hazard. To do this, you’ll need to make the Agent walk up the dry brush and then analyze it. Carefully count how far you’ll need to make the agent move. You’ll need to use multiple blocks in this challenge because there are multiple actions for the Agent to perform.
4. Technician - Gather Data
The fourth challenge is similar to the third challenge but has a more complex solution. When you talk to the technician, you’ll have two options to choose from. Whether you choose the short path or the long path, you’ll have to put together a sequence of code blocks to navigate the agent to the dry brush at the end of the path and then analyze it. The long path is recommended if you’re looking for more of a challenge. Look down over the edge of the building to see the path for the agent to navigate. Don’t worry; you can’t fall off.
5. AI Specialist - Fire Hazard
After the fourth challenge, talk to the Head of Research to gain access to the research center. Once inside, talk to the AI specialist to begin the next task. There is no coding in this section. Instead, you’ll have to manually identify whether the plants shown on the monitor are fire hazards. There are gray buttons labeled “Yes” and “No” on either side of the monitor. If the plant shown looks like a fire hazard, press the “Yes” button by right-clicking it; otherwise, press the “No” button.
6. Scientist - Eliminate All Hazards
For the fifth challenge, you’ll need to complete the scientist’s code so that the agent destroys only the plants that are fire hazards. Logic with a ‘while’ loop and an ‘if’ statement are already prepared in the code. You need to figure out what code needs to be added and where. If the Agent ever destroys a plant that is not a fire hazard, you’ll need to fix your code and try again.
7. Analyst - Alert the Team
For the sixth challenge, you’ll again need to finish a section of incomplete code. You need to add some code so that the Agent can notify the research team if it observes any areas susceptible to fires on the monitor. If the agent does not accurately identify the hazardous area, you'll need to change your code and try again.
8. Fire Captain - Save the Village
For the seventh challenge, talk to the Fire Captain in the helicopter to fly to the area the Agent identified in the seventh challenge. After arriving, talk to the Fire Captain again to learn what to do next. You’ll need to complete the existing code to make the agent move and destroy only the fire hazards. By destroying the fire hazards, any imminent fires will not be able to spread into the village.
9. Fire Fighter - Reforestation Process
For the eighth challenge, you get to write code to plant new crops and spawn animals. There are no wrong solutions here. If you add your code to the “on start” block, it will run when you press the Play button. However, you can also use the “on player walk” block to make code that will run whenever your player walks.
10. Exit the world
To exit the world, press the Escape key (Esc) on your keyboard to open the Pause menu. Then click on “I’m Finished” and “Exit Lesson”; click “EXIT LESSON” to confirm your selection and return to the demo mode menu. If you’d like to do more coding in demo mode, the Hour of Code 2020 (Inclusion) world offers more coding challenges.
More fun and free Hour of Code Minecraft activities
1. Free Minecraft modding class
This awesome 1-hour free intro class will introduce you to Minecraft: Education Edition, and how to code using it. We will show how to setup Minecraft Education first and then get everyone started on a self-guided tutorial that teaches basics of block coding and some key concepts. The tutorial lets you code a series of steps to prevent the spread of fire, save a village, and bring life back into a cool forest with the help of artificial intelligence. Join the Minecraft class here.
2. Free Minecraft modding tutorial
Imagine your character is running low on health and it’s surrounded by enemies. You could run a mod that replenishes your health and gives you weapons to defend yourself. Another example could be that you want to build a house, or any structure instantly. You could run a mod to build that structure anywhere in your world with a click of a button, instead of spending hours building it by hand.
All of these examples are possible thanks to the power of code, and with all the different resources available on the internet it’s becoming easier than ever for anybody to code mods. Before you can run all of these cool mods in Minecraft we first have to learn how to create them! Find out how to code Minecraft mods for kids here.
Try Hour of Code Minecraft activities
Written by Chris Youngs, who worked on Minecraft for over four years. He spent most of that time testing Minecraft: Education Edition, with a heavy emphasis on the CodeBuilder feature. He joined the Create & Learn team to help teach young students the basics of programming with Minecraft: Education Edition.