Lesson plan

Aquarium

Students write sequenced chat commands and use 3D coordinates to construct an aquarium model illustrating the nitrogen cycle.

Aquarium
Ages
Ages 11-13
Essential question

How can sequenced computer code and 3D coordinates model the cycling of matter in an aquatic ecosystem?

Overview

In an aquatic ecosystem, nitrogen enters the environment and recycles through multiple stages involving living organisms and nonliving substrates. Understanding these interactions requires students to analyze how matter cycles and energy flows between fish, plants, water, and decomposing elements.

Using Minecraft Education, students translate ecological components into code. By applying three-dimensional world coordinates, nested chat commands, and block-filling algorithms, learners construct an automated aquarium system from bedrock to living fish.

Learning objectives

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

  • Develop a model describing the cycling of matter and energy flow among living and nonliving ecosystem components.
  • Apply the three-dimensional world coordinate system to place blocks accurately.
  • Program fill, replace, and spawn commands to generate layered aquatic habitats.
  • Sequence multiple individual chat commands inside a single master command.

Blocks and items used in this lesson

Key vocabulary

Nitrogen Cycle
The process by which nitrogen enters an ecosystem and recycles through successive stages.
World Coordinates
A three-dimensional system of three numbers identifying the exact position of any block in a world.
Fill Command
A coding instruction used to place or replace blocks across a defined coordinate area.
Master Command
A primary chat command programmed to trigger a series of subordinate commands in order.

Before class

Lesson sequence

  1. Command Setup

    Organize students into pairs or small groups. Instruct them to set up eight separate on-chat command blocks labeled: tank, glass, air, gravel, sand, water, fish, and undo.

  2. Building the Tank and Undo Code

    Students code the glass command using fill with glass from world coordinates 1861 66 10 to 1840 76 -6 with the hollow parameter. Next, they duplicate this block into the undo command, replacing glass with air so they can reset the area if needed.

  3. Adding Substrate and Carbon

    Students program the air command to open the top of the tank, then script the gravel and sand layers by adjusting the vertical coordinate values. Within the sand layer, they attach a replace with bone block instruction at specific coordinates to introduce carbon into the system.

  4. Filling Water and Spawning Organisms

    Students program the water command using adjusted interior coordinates. Under the fish command, students place an animal spawn instruction inside a repeat loop targeted at the center of the aquarium to generate a set number of fish.

  5. Nesting Commands and Ecosystem Modeling

    Students clear the space with undo, then nest their sub-commands inside the master tank command in this exact sequence: glass, air, gravel, sand, water, and fish. After running the master command, students manually add sea grass and kelp to complete their nitrogen cycle model.

Assessment: success criteria

  • The student successfully uses world coordinates and the hollow fill command to build the tank.
  • The student programs a functional undo command that clears the build volume with air.
  • The master tank command correctly triggers the full sequence of six chat commands in order.
  • The student explains the roles of fish, plants, and decomposing matter in the nitrogen cycle.

Differentiation

Support

Allow students to work in pairs so one partner tracks world coordinates while the other enters the code blocks.

Stretch

Have students add additional aquatic plants and explain where decomposing matter accumulates within their tank model.

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 do students create an 'undo' chat command using air blocks across the tank coordinates?

  2. 2Which command introduces carbon into the sand layer of the aquarium model?

  3. 3How is the number of spawned fish controlled in the code?

  4. 4In what order are sub-commands nested inside the master 'tank' chat command?

  5. 5Which parameter ensures the glass tank is an open container rather than a solid block of glass?

Resources

Part of the Code for STEM curriculum

This is lesson 2 of 20 in Code for STEM.

  1. 3-D Fractions
  2. Aquarium
  3. Build a Dam
  4. Canyon Arch Bridge
  5. Chicken or the Egg
  6. Creeper Tower Test
  7. Energy Transfer
  8. Forces
  9. Hour of Code: AI for Good
  10. Minecraft Code Town
  11. Molecules
  12. Number Line Railroad
  13. Plate Motions
  14. Road Construction Ahead
  15. Scale
  16. Slope
  17. Surface Area and Perimeter
  18. Units of Measurement
  19. Walled Fortress
  20. Wave Properties

Frequently Asked Questions

Why do students switch from relative coordinates (~) to world coordinates?

World coordinates ensure the commands build the tank at fixed, absolute positions on the bedrock foundation, preventing the build from shifting depending on where the player stands.

How does this lesson connect to NGSS MS-LS2-3?

Students construct a visual and functional model showing how matter and energy cycle through living elements like fish and plants alongside nonliving components like sand, water, and carbon.

Adapted from Aquarium by John Miller on Minecraft Education, last updated Aug 19, 2021. 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