
- Type
- Lesson plan
- Subject
- Computer Science & Coding
- Topics
- Computer Science
- Ages
- Ages 8-13
- Includes
- Quiz: 5 questions
How can we use automated code and data interpretation to design an efficient and safe vertical mining operation?
Overview
Vertical shaft mining provides an accessible way to study automation and computational thinking. By programming the Agent with loops and conditional checks, students eliminate repetitive manual digging while learning how automated instructions interact with an open 3D environment.
Using an ore distribution graph from the lesson handout, learners examine the trade-offs of mining at varying depths. Students collect foundational survival items, manage shafts lined with ladders, and evaluate mining patterns to maximize their yield of valuable ores.
Learning objectives
By the end of this lesson students will be able to:
- Program the Agent using parameterized and hard-coded loops to excavate vertical shafts and horizontal tunnels.
- Interpret an ore distribution graph from a handout to identify optimal subterranean mining elevations.
- Explain how conditional logic allows the Agent to detect environmental blocks and selectively collect items.
- Develop a resource management plan using ladders, torches, and crafted tools to navigate and illuminate deep shafts.
Blocks and items used in this lesson
Agent
Ladder
Coal
Charcoal
Cobblestone
Key vocabulary
- Parameterized Loop
- A programming loop where a variable or numeric input sets the exact number of repetitions, such as shaft depth.
- Conditionality
- A coding structure that performs actions only when specific circumstances are met, such as checking for a block in front.
- Vertical Shaft
- A deep, straight vertical passage dug into the ground to reach lower geological layers.
Before class
Lesson sequence
- Warm-up & Data Analysis
Introduce the challenge of vertical shaft mining. Direct students to the handout graph to analyze which depths contain key resources and discuss shaft dimensions, such as a 3x1 opening, while planning how to prevent lethal falls.
- Surface Preparation & Code Setup
While the world remains set to daytime, students gather wood to craft a crafting table and ladders. Students then enter the Agent code from the handout to prepare their automated digger.
- Shaft Excavation & Inventory Check
Run the Agent code to dig the vertical shaft and line the walls with ladders for safe descent. Students right-click the Agent to inspect its inventory, then secure lighting by mining coal or making charcoal in a cobblestone furnace to produce torches.
- Tunneling & Pattern Exploration
Learners program the Agent to mine outward from the shaft base. Students compare straight paths against grouped block patterns to locate ore clusters efficiently, considering how conditional checks could help the Agent harvest only desired blocks.
- Review & Extensions
Gather the class to share mining depth strategies and code modifications. For extended work, students can restore the day-night cycle to build a shelter around their bed, create an underground base with crafting stations, or design stairs or waterfall lifts.
Assessment: success criteria
- Student accurately explains how the handout graph informed their selected mining elevation.
- Student configures Agent loop parameters to dig a vertical shaft without creating dangerous falling hazards.
- Student retrieves items by right-clicking the Agent and crafts needed tools, ladders, or torches.
- Student explains how conditional statements enable the Agent to inspect blocks or collect specific resources.
Differentiation
Assist students with entering the starter code parameters from the handout and remind them to place ladders continuously while digging downward.
Challenge students to re-enable the day-night cycle, build a secure surface house or underground base, and code alternative transit routes such as stairs or waterfalls.
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.
1What is the main function of the graph provided on the student handout?
Answer: A. The handout graph provides data that lets students see which materials spawn at specific depths and assess the likelihood of finding them.
2Why might mining outward in a simple straight line be less effective for finding rare ores?
Answer: B. Because ores typically spawn in clusters, students are encouraged to design specific mining patterns rather than relying only on straight paths.
3If raw coal has not yet been uncovered, how can students obtain torches?
Answer: C. The lesson outlines crafting torches by either mining coal directly or smelting wood into charcoal using a cobblestone furnace.
4How does conditionality improve the Agent's automated mining routine?
Answer: D. Conditionality allows the Agent to check whether a block is present and decide whether to collect only target materials.
5How can a player inspect the materials that the Agent has excavated?
Answer: A. Right-clicking the Agent allows players to view and retrieve the items it has collected during excavation.
Frequently Asked Questions
Why does the lesson begin with the world set to always day?
Keeping the world in daytime allows students to focus on coding the Agent, gathering basic wood, and crafting ladders without nighttime hazards or hostile creatures interfering.
What considerations should guide the depth and width of the shaft?
Students should choose practical dimensions such as a 3x1 opening and plan safe descent routes so that an accidental fall down the shaft is not fatal.
Adapted from Mining with the Agent: Part I by Philip Golden on Minecraft Education, last updated Jun 21, 2018. This classroom version, the timings and the quiz were written by 9Minecraft Education.















