Lesson plan

Hour of Code: AI for Good

Program the Minecraft Agent to gather wildfire data, clear fire hazards, protect a village, and restore a burned forest using AI concepts.

Hour of Code: AI for Good
Ages
All ages
Duration
1 hour
Essential question

How can we use computer programming and artificial intelligence to prevent forest fires and restore damaged habitats?

Overview

Wildfires pose a critical threat to communities and natural habitats, making early detection and prevention essential. In this lesson, students explore how computer science and concepts of artificial intelligence can be deployed to protect environments by collecting environmental data and predicting where fires might break out.

Working inside a dedicated research world, learners command the Minecraft Agent through a series of eight structured coding quests. Students write instructions to navigate terrain, analyze flammable brush, apply conditional logic to clear hazards, defend a settlement, and reforest the damaged landscape.

Learning objectives

By the end of this lesson students will be able to:

  • Explain how artificial intelligence and data collection help predict and manage forest fires.
  • Construct computer programs using sequences, events, loops, and conditional statements.
  • Decompose complex environmental problems into step-by-step coding instructions.
  • Iterate on program code to eliminate fire hazards and complete reforestation tasks.

Blocks and items used in this lesson

Key vocabulary

Agent
A programmable helper character in Minecraft that carries out coded instructions.
Artificial Intelligence
Computer systems designed to process information and make decisions, such as predicting fire risks.
Conditional
A rule in code that performs different actions depending on whether a condition is true or false.
Decomposition
The process of breaking a complex problem down into smaller, manageable steps.
Reforestation
The process of replanting trees and restoring vegetation to an area damaged by fire.

Before class

Lesson sequence

Suggested timing: about 60 minutes in total.

  1. Introduction and Setup10 min

    Introduce the lesson theme by screening the intro video. Discuss the threat of forest fires and explain that students will program an Agent to gather field data and protect a nearby village.

  2. Basic Coding and Data Collection15 min

    Students log in and start outside the Fire Research Center. They complete Quests 1 through 4 by opening the gate, moving the Agent forward, and directing it to inspect and gather data from dry brush.

  3. Hazard Removal and Village Defense20 min

    Learners tackle Quests 5 through 7. They write conditional code instructing the Agent to inspect items and destroy flammable hazards while leaving safe objects untouched, creating a buffer between the plains and the village.

  4. Reforestation and Reflection15 min

    Students complete Quest 8 by coding the Agent to plant new growth across burned ground, followed by free-play coding time. Conclude with a class discussion on reforestation and the role of computers in fire prevention.

Assessment: success criteria

  • The student can successfully program the Agent to navigate toward targets and collect data.
  • The student uses conditional logic so the Agent destroys only flammable materials.
  • The student breaks down multi-step tasks to save the village and restore vegetation.
  • The student can articulate what role computers and data play in forest fire prevention.

Differentiation

Support

Pair struggling students with a partner and refer directly to the coding solutions guide to fix broken sequences.

Stretch

Encourage advanced learners to use the open-ended exploration time to optimize their loops and test more efficient reforestation patterns.

Knowledge check

5 questions to check understanding after the lesson. Tap an answer to see if it is right; the score appears at the end.

  1. 1What is the primary role of the Agent in this lesson?

  2. 2In Quest 5, what rule must the Agent follow when inspecting objects?

  3. 3Why is collecting data on dry brush important?

  4. 4What coding concept involves breaking a large problem into smaller, precise steps?

  5. 5What is the focus of the final quest (Quest 8)?

Resources

Part of the Code for STEM curriculum

This is lesson 9 of 20 in Code for STEM.

  1. 3-D Fractions
  2. Aquarium
  3. Build a Dam
  4. Canyon Arch Bridge
  5. Chicken or the Egg
  6. Creeper Tower Test
  7. Energy Transfer
  8. Forces
  9. Hour of Code: AI for Good
  10. Minecraft Code Town
  11. Molecules
  12. Number Line Railroad
  13. Plate Motions
  14. Road Construction Ahead
  15. Scale
  16. Slope
  17. Surface Area and Perimeter
  18. Units of Measurement
  19. Walled Fortress
  20. Wave Properties

Frequently Asked Questions

Do students need prior coding experience to complete this lesson?

No, the lesson is designed for beginners of all ages, starting with simple navigation instructions before introducing conditionals and loops.

How long does it take to complete all eight quests?

The lesson is structured as a one-hour Hour of Code experience, including introductory videos, guided quests, and a concluding discussion.

What resources are available if students get stuck on a coding quest?

Teachers can consult the provided coding solutions document and walkthrough video to help guide students through challenging tasks.

Adapted from Hour of Code: AI for Good by Minecraft Education on Minecraft Education, last updated Nov 6, 2025. This classroom version, the timings and the quiz were written by 9Minecraft Education.

You May Also Like

9Minecraft Education is an independent teaching resource and is not affiliated with Mojang or Microsoft. Lesson plans here are our own classroom-ready adaptations; each one links to the original resource and credits its author. © 2026 9minecraft.net