
- Type
- Build challenge
- Topics
- ScienceComputer Science
- Duration
- about 60 min (suggested)
- Includes
- Quiz: 5 questionsMinecraft world
How can we use computer programming to model and restore damaged marine ecosystems like coral reefs?
Overview
Coral reefs support rich marine biodiversity and are frequently compared to underwater rainforests. However, human activities such as pollution, coastal development, and global climate change have damaged or destroyed many of these fragile marine environments around the world.
In this challenge, students connect marine science with computer science by using code to restore a damaged reef. Working in MakeCode, learners program their Agent helper using pre-made or custom functions to place coral blocks and generate underwater reef structures.
Learning objectives
By the end of this activity students will be able to:
- Identify key threats contributing to coral reef destruction, such as pollution and climate change.
- Program the Agent to place blocks and build coral reef formations using MakeCode functions.
- Communicate problem-solving strategies and structural designs with classmates.
Blocks and items used in this lesson
Agent
Tube Coral Block
Brain Coral Block
Fire Coral Block
Bubble Coral Block
Horn Coral Block
Water Bucket
Key vocabulary
- Biodiversity
- The variety of different living plant and animal species found within an ecosystem.
- Agent
- A programmable helper in Minecraft that carries out automated building and movement tasks using code.
- Function
- A reusable block of code designed to perform a specific task, such as building a coral shape.
Before class
Lesson sequence
Suggested timing: about 60 minutes in total.
- Introduction & Discussion10 min
Introduce coral reefs as underwater rainforests rich in biodiversity. Discuss the primary causes of reef destruction highlighted in the challenge, including climate change, pollution, and coastal development.
- Coding Setup & Exploration15 min
Demonstrate how to import the provided MakeCode file. Have students review the pre-written functions that instruct the Agent to construct coral structures, or examine how to write custom functions from scratch.
- Reef Building Challenge25 min
Students run their MakeCode programs to direct their Agent in placing coral structures across the sea floor. Learners refine their code and arrange reef patterns to rebuild the marine habitat.
- Review & Extension10 min
Students present their completed reefs to peers. Fast finishers can expand their site by building a research submarine, creating an underwater station, or capturing screenshots for a research report.
Assessment: success criteria
- Student successfully imports or writes MakeCode functions to control the Agent.
- The Agent automates the construction of coral formations in the ocean.
- Student explains at least one real-world threat to coral reefs and how their build models reef restoration.
Differentiation
Provide direct guidance on importing the starter MakeCode file and running the included example functions step-by-step.
Write original custom functions for diverse coral shapes, build an ocean research station or submarine, or export the reef model using a structure block.
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 coding tool is used to program the Agent in this challenge?
Answer: A. The challenge uses a provided MakeCode file to write functions that instruct the Agent.
2Why are coral reefs often referred to as the rainforests of the sea?
Answer: B. The source notes coral reefs are called underwater rainforests because of their amazing biodiversity.
3Which three factors are identified as major causes of reef destruction?
Answer: C. The lesson explicitly lists climate change, pollution, and coastal development as causes of reef destruction.
4What does the provided starter MakeCode file contain to help students begin?
Answer: D. The source states that the downloadable file includes example functions instructing the Agent to build coral structures.
5What in-game tool can students use to export a 3D model of their finished reef?
Answer: B. The extensions list exporting a model of the reef with a structure block as an option.
Resources
Frequently Asked Questions
Do students need prior coding experience to participate in this lesson?
No prior coding experience is necessary because the challenge includes an example MakeCode file with pre-made functions for the Agent, allowing beginners to learn by running existing code while advanced learners can write their own.
How can students document or share their completed reef project?
Students can take in-game screenshots to illustrate a research report, export their reef model using a structure block, or share their build using the suggested community hashtags.
Adapted from Coding Coral by Minecraft Education on Minecraft Education, last updated May 23, 2025. This classroom version, the timings and the quiz were written by 9Minecraft Education.







