All lesson plans

First Steps in Coding with Code Builder

Coding · Grades 3-9

Code Builder brings block based programming (MakeCode) into Minecraft. Students write code that an in game agent runs, turning loops and conditionals into visible actions.

Objective

Students use sequences, loops and simple conditionals to make the agent complete a task.

Materials

Steps

  1. Open Code Builder and connect MakeCode. Move the agent forward with a single block.
  2. Use a repeat loop to make the agent build a 5 block wall.
  3. Add a turn so the agent builds a square.
  4. Introduce an if statement: place a block only if the space ahead is empty.
  5. Challenge: have the agent plant a row of crops using a loop.

Discussion questions

Variations

Older students convert the same logic to the JavaScript tab in MakeCode to see text based code.