Lesson plan

Codegame

Beginners learn to open MakeCode, program the Agent through unique pathways, and collaborate on building projects and custom puzzles.

Codegame
Download lesson files
Ages
Ages 6-10
Essential question

How can you teach the Agent to successfully navigate a pathway using simple code commands?

Overview

This introductory computer science lesson introduces young learners to the fundamentals of coding by guiding an in-game helper called the Agent. Students learn how to open the coding editor and assemble straightforward instruction sequences to navigate pathways, building confidence in early algorithmic thinking.

Using a pre-built world configured in immutable creative mode, individual students are assigned one of fourteen distinct path challenges. Once they guide their Agent through their assigned course, learners move to a designated building zone to experiment freely with blocks and construct their own puzzle challenges together.

Learning objectives

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

  • Launch the MakeCode coding interface using chat commands or connection shortcuts.
  • Program the Agent using a sequence of basic navigation commands to solve a designated path puzzle.
  • Apply conditional logic such as if-else statements to make the Agent navigate paths more efficiently.
  • Collaborate with peers in the designated building area to design custom block structures and puzzles.

Blocks and items used in this lesson

Key vocabulary

Agent
A programmable in-game character that can move, turn, and execute tasks in Minecraft.
MakeCode
The coding environment used to write and run commands for the Agent.
Conditional Logic
Rules that tell a program to take different actions based on whether a condition is true or false, such as if and else.
Immutable World
A world setting where players cannot break or place blocks, except in designated build areas.

Before class

Lesson sequence

  1. Introduction and Code Launch

    Introduce the lesson objective to the class: guiding the Little Agent through a pathway puzzle using code. Demonstrate how to open the coding workspace by pressing T on the keyboard and entering /code, or by using the Code Connection shortcut.

  2. Pathway Coding Challenge

    Assign each student their specific pathway number from the 14 available tracks. Students write simple code sequences to guide their Agent step-by-step through their designated path between the barriers.

  3. Logic Extension and Building

    After completing their pathway puzzle, students travel to the open building area where world restrictions allow block placement. Students experiment with block building and work collaboratively to construct their own puzzle pathways for others to try.

Assessment: success criteria

  • Student successfully launches the MakeCode interface independently or with minimal guidance.
  • The Agent reaches the end of the assigned pathway using written code commands.
  • Student demonstrates cooperation and block manipulation within the permitted building zone.
  • Advanced students successfully integrate if-else logic to streamline their navigation code.

Differentiation

Support

Assist learners with opening the coding interface via the /code command and keep their code sequences to simple, single-step movement commands.

Stretch

Challenge advanced students to use conditional logic blocks like if and else rather than long strings of manual movement commands.

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. 1How do players open the MakeCode editor inside the game?

  2. 2How many individual pathways are provided in the world for students to work on?

  3. 3What should students receive from the teacher before starting the pathway challenge?

  4. 4What are students encouraged to do in the building area after solving their pathway?

  5. 5What coding concept can more advanced students use instead of writing numerous manual commands?

Resources

Frequently Asked Questions

Can students place blocks anywhere in the world?

No. The world is configured in creative mode but remains immutable, meaning blocks can only be placed and modified within the designated building area.

What should I do if a student struggles to open the coding window?

Ensure they press the T key to open the text chat bar, type /code, and press enter, or assist them in using the Code Connection shortcut key.

Adapted from Codegame by Jón Stefánsson on Minecraft Education, last updated Jun 3, 2022. 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