Lesson plan

Mining with the Agent: Part II

Students program their Agent using functions and loops to dig staircase or spiral shafts, gather materials for torches, and plan efficient mining routes.

Mining with the Agent: Part II
Ages
Ages 6-10
Essential question

How can we use reusable code and strategic planning to automate efficient underground mining?

Overview

In this lesson, students advance beyond basic vertical shafts to automate sophisticated excavation patterns such as linear staircases and spiral descents. By reading distribution charts to target specific depths and constructing modular code, learners explore how strategic automation saves resources while opening access to valuable ores.

Using Minecraft Education, students write parameterized loops and define a reusable step function to guide their Agent into the earth without requiring ladders. As the Agent collects materials, students inspect its inventory, craft vital illumination sources like torches or charcoal, and design thoughtful subterranean routes.

Learning objectives

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

  • Program an Agent using parameterized loops and a reusable step function to carve staircase or spiral mining shafts.
  • Analyze resource distribution data from a graph to select appropriate depth levels for excavation.
  • Plan an efficient mining strategy to collect resources for crafting essential light sources such as torches.
  • Evaluate the tradeoffs between straight-line mining, spiral shafts, and branch mining patterns.

Blocks and items used in this lesson

Key vocabulary

Function
A named block of reusable code that performs a specific action, such as digging a single step.
Loop
A programming structure that repeats a sequence of instructions multiple times based on set parameters.
Parameter
A variable value given to a command or loop to determine how it runs, such as shaft depth.
Conditionality
A rule in programming that runs code only when a specific condition is met, such as collecting only certain blocks.
Branch Mining
A method of digging systematic offshoot tunnels from a main shaft to uncover clustered ores efficiently.

Before class

Lesson sequence

  1. Warm-up: Shaft Tradeoffs

    Introduce the transition away from the laddered vertical shafts used previously. Lead a discussion comparing simple linear staircases with spiral staircases, examining why spiral designs are useful and where they appear beyond Minecraft.

  2. Explore: Reading Resource Graphs

    Direct students to analyze the resource graph on their handout. Learners determine target elevations for locating specific materials and discuss how the graph indicates the relative likelihood of discovering rare blocks at varying depths.

  3. Code: Defining the Step Function

    Guide students to code a modular step function for the Agent. Have them incorporate this function into parameterized loops to build both staircase and spiral shaft commands.

  4. Build: Excavation and Lighting

    Students run their commands to have the Agent excavate shafts to their chosen depth. Learners right-click the Agent to check collected items, prioritizing torch production either by mining coal or making charcoal in a furnace using gathered cobblestone.

  5. Reflect: Mining Patterns and Extensions

    Discuss why straight-line mining is inefficient given that ores generate in clusters. Students consider branch mining diagrams, discuss how conditional block collection could work, or proceed to extensions like turning on the day-night cycle, building a base, or crafting tools and armor.

Assessment: success criteria

  • Student interprets the handout graph to verbalize a justified target level and strategy for excavation.
  • Student correctly writes a reusable step function that is called by their staircase or spiral shaft commands.
  • Student accesses the Agent inventory by right-clicking and secures light sources using mined coal or furnace charcoal.
  • Student explains the strategic advantages of spiral shafts and non-linear mining patterns for clustered ores.

Differentiation

Support

Provide partially assembled code on the handout so struggling learners only need to adjust numerical loop parameters.

Stretch

Re-enable the day-night cycle, build an underground base around a bed, and draw a branch mining diagram to plan horizontal excavation.

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. 1Why is a modular step function useful when coding staircase and spiral shafts?

  2. 2What essential item must players obtain before exploring shafts to significant depths?

  3. 3According to the lesson, what are the two ways students can obtain torches from mined resources?

  4. 4How can a player inspect the materials the Agent has gathered during excavation?

  5. 5Why is continuing to mine in a single straight line often inefficient for finding rare minerals?

Frequently Asked Questions

Why are ladders unnecessary in this lesson compared to Part I?

Because the Agent builds continuous staircases or spiral descents, players can walk up and down the steps directly without having to craft or place ladders.

How does the handout support students' strategic decisions?

The handout provides code templates for functions and commands, alongside an ore distribution graph that students read to determine which depth levels yield the highest probability of useful resources.

What should students do if their Agent does not encounter coal deposits?

Students can use the cobblestone gathered by the Agent to craft a furnace, allowing them to burn wood into charcoal to produce the torches required for deep exploration.

Adapted from Mining with the Agent: Part II by Philip Golden on Minecraft Education, last updated Jun 14, 2018. 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