Build challenge

Coding Coral

Students explore coral reef biodiversity and threats by programming the Agent with MakeCode to construct and restore an underwater coral reef.

Coding Coral
Essential question

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

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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

Support

Provide direct guidance on importing the starter MakeCode file and running the included example functions step-by-step.

Stretch

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.

  1. 1What coding tool is used to program the Agent in this challenge?

  2. 2Why are coral reefs often referred to as the rainforests of the sea?

  3. 3Which three factors are identified as major causes of reef destruction?

  4. 4What does the provided starter MakeCode file contain to help students begin?

  5. 5What in-game tool can students use to export a 3D model of their finished reef?

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.

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