Lesson plan

Minecraft Space Center

Students complete space explorer training in MakeCode by programming the Agent with repeat loops, while loops, and conditional statements.

Minecraft Space Center
Ages
Ages 8-10
Duration
1 hour
Essential question

How can we use loops and conditional statements to help an Agent navigate and respond to its environment?

Overview

In this introductory coding lesson, learners step into the role of space explorers on their first day of training at the Minecraft Space Center. The session builds on previous programming fundamentals by strengthening students' grasp of repeat loops while introducing more sophisticated control structures, specifically while loops and conditional logic.

Using Microsoft MakeCode, students program the Agent companion to inspect blocks, respond to environmental obstacles, and traverse challenging paths. Through progressive hands-on tasks, learners discover how computers make decisions based on specific conditions and how loops help automate repetitive actions in both flat and three-dimensional spaces.

Learning objectives

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

  • Revisit and apply repeat loops to automate routine Agent actions.
  • Identify and use new MakeCode blocks to control the Agent companion.
  • Construct coding sequences using while loops to repeat actions until a condition changes.
  • Implement conditional statements, such as if and if-else, to help the Agent make decisions.

Blocks and items used in this lesson

Key vocabulary

Repeat Loop
A coding command that runs a specific set of instructions a fixed number of times.
While Loop
A loop that continues executing instructions as long as a specified condition remains true.
Conditional
A rule or decision-making statement that performs different actions depending on whether a condition is true or false.
Agent
A programmable helper in Minecraft that carries out automated commands and detects blocks.

Before class

Lesson sequence

Suggested timing: about 60 minutes in total.

  1. Welcome to Space Explorer Training10 min

    Introduce students to their first day of training at the Space Center. Review prior knowledge of basic repeat loops and explain that astronauts rely on automated machines that must observe their surroundings and react appropriately.

  2. Detecting Materials and Surroundings15 min

    Guide students through Activities 1 and 2 in the Space Center. Learners program the Agent using a repeat loop with an if conditional to detect a target material, then progress to using a while loop paired with an if-else statement to inspect nearby obstacles.

  3. Navigating Complex Pathways20 min

    Students tackle Activity 3 and Activity 4. They write code for the Agent to maneuver through a spiral course using while loops and if-else logic, followed by an advanced challenge combining repeat loops, while loops, and conditionals to navigate 3D space.

  4. Simulation Challenge and Reflection15 min

    Fast finishers attempt the bonus simulation activity while the class gathers for debriefing. Facilitate a discussion reviewing how while loops differ from repeat loops and conduct the formative check questions.

Assessment: success criteria

  • Student successfully demonstrates how to stop a while loop using a designated condition.
  • Student explains the purpose of if and if-else statements in guiding Agent behavior.
  • Student correctly locates and deploys conditional and Agent blocks inside the MakeCode interface.

Differentiation

Support

Pair students together to practice reading conditional logic out loud before dragging blocks into their workspace.

Stretch

Direct students to complete the bonus activity, Just Like the Simulations, to refine their multi-loop navigation code.

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 determines when a while loop stops executing code?

  2. 2What is the primary function of a conditional statement in computer programming?

  3. 3Which tool or helper does a player program to find and detect specific blocks in this lesson?

  4. 4Which coding structure was reviewed from earlier lessons before moving into while loops?

  5. 5Which combination of code structures is used in Activity 4 to move through 3D space?

Resources

Part of the Coding Fundamentals curriculum

This is lesson 8 of 17 in Coding Fundamentals.

  1. Basic Moves and the Agent
  2. Coding Challenge
  3. Dinosaur Run
  4. Earth’s Moon & Mars
  5. Ganymede (Jupiter's Moon) & Saturn's Rings
  6. Gray Wolves
  7. Mercury and Venus
  8. Minecraft Space Center
  9. Panda's Protected Habitat
  10. Polar Bear Rescue
  11. Revisiting Biomes
  12. Revisiting Planets
  13. Sea Turtle Assistance
  14. The Experiment
  15. Uranus’ Rings and Neptune's Moon, Triton
  16. We Need Beets!
  17. Wild West

Frequently Asked Questions

What coding platform do students use for these Space Center challenges?

Students use Microsoft MakeCode block coding inside Minecraft Education to write programs for the Agent.

Where can I locate the printable formative assessment questions for my class?

The printable version of the formative assessment questions is included at the end of the educator guide found in the supporting files.

Adapted from Minecraft Space Center by Minecraft Education on Minecraft Education, last updated Sep 16, 2023. 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