Lesson plan

Coding Your Agent

Students program their Minecraft Agent using Microsoft Code Builder to construct four distinct 3D shapes and modify their dimensions with variables.

Coding Your Agent
Download lesson files
Ages
Ages 8-13
Essential question

How can we develop algorithms and adjust variables to build and resize 3D geometric shapes in Minecraft?

Overview

This interdisciplinary lesson bridges mathematics and computer science by challenging learners to translate spatial geometry into programmatic algorithms. Students analyze the structural characteristics of cubes, cuboids, triangular prisms, and pyramids, exploring how faces, edges, and vertices relate to sequential movement and placement commands.

Learning objectives

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

  • Identify and describe the geometric properties of a cube, cuboid, triangular prism, and pyramid.
  • Write functional algorithms in Microsoft Code Builder to guide the Agent in building 3D shapes.
  • Apply debugging strategies when the Agent produces unexpected construction results.
  • Adjust algorithm variables to modify the physical dimensions of built shapes.

Blocks and items used in this lesson

Key vocabulary

Algorithm
A step-by-step set of instructions designed to accomplish a specific task.
Debugging
The process of identifying and correcting errors in computer code.
Variable
A changeable value in a program that can define attributes such as shape dimensions.
Cuboid
A solid three-dimensional shape bounded by six rectangular faces.
Triangular Prism
A three-dimensional solid with two parallel triangular bases joined by rectangular sides.

Before class

Lesson sequence

Suggested timing: about 130 minutes in total.

  1. Shape Properties Discussion30 min

    Review the properties of the four required three-dimensional shapes: cube, cuboid, triangular prism, and pyramid. Discuss how spatial dimensions such as height, width, and base shape determine how an automated builder must move.

  2. Planning in the Amazing Code World30 min

    Have students launch the Amazing Code world and locate their designated building zones. Learners draft a step-by-step plan or pseudocode outlining how the Agent will navigate each layer of the target shapes.

  3. Writing and Debugging Code45 min

    Students open Microsoft Code Builder to write algorithms directing the Agent to construct the shapes. When the Agent makes building errors, learners inspect their logic, test variations, and debug the code until the geometric forms are accurate.

  4. Modifying Dimensions with Variables25 min

    Learners refine their scripts by incorporating variables to adjust shape dimensions. Students test their modified code to confirm that altering numerical values dynamically resizes the structures without breaking the base algorithm.

Assessment: success criteria

  • The Agent successfully constructs a cube, cuboid, triangular prism, and pyramid in the Amazing Code world.
  • The student explains and demonstrates effective debugging methods when code fails.
  • The student successfully modifies code variables to change the dimensions of their structures.

Differentiation

Support

Provide a simplified sequence chart mapping out the Agent's movements for the cube before attempting irregular shapes.

Stretch

Challenge students to design a parameterized algorithm where modifying a single variable scales the height and base of a pyramid proportionally.

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. 1Which set of four 3D shapes are students challenged to build in this lesson?

  2. 2What tool within Minecraft Education is used to instruct the Agent?

  3. 3What is the primary purpose of modifying variables in the construction algorithms?

  4. 4What should a learner do when their Agent fails to build a shape correctly?

  5. 5Which downloadable world file serves as the setting for this activity?

Resources

Frequently Asked Questions

What materials are needed before starting the coding challenge?

You will need devices with Minecraft Education installed, access to Microsoft Code Builder, the downloadable Amazing Code World, and the supporting challenge documentation.

How should this challenge be paced across class sessions?

Because the challenge is estimated at roughly two or more hours, teachers can easily split it into separate sessions focusing first on 3D geometry and planning, followed by programming, debugging, and variable experimentation.

Adapted from Coding Your Agent by Hwb MLCs on Minecraft Education, last updated Jun 3, 2022. 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