Lists: Many Materials, One Loop
An array of block types and a loop that walks it — a rainbow wall, a striped tower, a pattern you can reorder in one place.
A three-section Minecraft Education course for ages 8–16. Start by programming the Agent in MakeCode, move to Minecraft's own commands and command blocks, then build whole games of your own — parkour, quiz, maze and more.
Block coding inside Minecraft Education's Code Builder. One new idea per lesson — loops, variables, if, functions, lists, events — then ninety minutes of challenges building with it. By the end a forest, a farm and an aquarium each take one program instead of one afternoon.
Everything needed to begin, in one go: a flat Creative world with coordinates on, the movement keys, Code Builder, and on chat command programs that move, turn and teleport the Agent.
MC-L1-02Fill the Agent's inventory from code, place on down or forward, and destroy. First builds: a line of stone, the letters MC, a square outline and a ten-block tower.
Nine blocks become three. One repeat turns a five-block line into a fifty-block line without touching the program.
MC-L1-04A row loop inside a turn loop inside a height loop — a 5×5 wall, a hollow room, a hut with a doorway, and why one slot of 64 blocks is the real ceiling on how big you can build.
MC-L1-05Store the wall size in a variable so it can never disagree with itself, then add a number to the chat command — type "wall 20" and the program builds to order without you opening the code.
MC-L1-06Guard the number the player typed — nothing happens on zero, and 40 is more than a slot holds — then let the build pick its own material. Small builds get stone, big builds get glass, and the program decides.
Three numbers name any block in the world, and two corners name a box. One fill block builds the whole thing at once — no Agent, no walking, no inventory and no 64-block ceiling.
MC-L1-08A world address never moves; ~ ~ ~ follows you. Then stack fills of different materials — foundation, walls, a band of windows, a roof — so a build stops being a box and starts being a house you can drop anywhere.
Mobs are not blocks — they wander, and they cannot be cloned. Build the pen first, then spawn the herd inside it with a loop; then a glass tank, water inside the glass, and fish.
MC-L1-10Copy a finished structure anywhere in the world — a street of five houses from one. Mobs have to be spawned again after cloning.
MC-L1-11Wrap a wall in a function called buildWall, then call it four times. The lesson where earlier programs get rewritten short.
MC-L1-12A whole session on one build, using everything so far — partitioned rooms and a roof from loops and variables, mobs released inside, a clone backup that repairs the maze when it breaks, and the walls raised by a function you wrote.
An array of block types and a loop that walks it — a rainbow wall, a striped tower, a pattern you can reorder in one place.
pick random for materials, heights and positions. A forest where every tree differs, generated fresh each run.
on block broken, on block placed, on player walk on. Code that waits for the player instead of a typed command — traps and rewards.
agent detect feeding an if. The Agent stops at a wall, bridges a gap, and stops walking off cliffs.
Repeat an unknown number of times. Dig until bedrock, walk until a wall — the loop that ends when the world says so.
A whole session on one brief — fenced pens, layered materials, two species spawned inside, built from functions you wrote.
Glass shell, water fill, seagrass floor and three kinds of fish, all at a world position so the class can visit each other's.
Forest, river and a cloned village, generated with random and functions. The portfolio piece for the section.
Finish the build, then export the world and play a classmate's. The share-and-export step every original lesson ended on, given a slot of its own.
Build to a written brief using loops, a variable, a function and fill — then explain what each part of your program does.
Typed Minecraft commands, then the blocks that store and chain them. Impulse, chain and repeat; testforblock, testfor and scoreboards; NPCs, redstone and the Education-edition blocks that keep a map from being wrecked. The section ships a playable adventure map with a start, a win and a reset. Prereq: Section 1.
Cheats, operator rights, and reading a syntax line. /gamemode, /give, /clear, /time and /weather — the five you reach for in every lesson after this.
Who a command acts on, and the filters that narrow it: [type=chicken], [r=30], [c=1]. The idea that makes every later command precise.
The typed version of Section 1's Blocks category, plus what MakeCode never showed — the fill modes hollow, outline, keep and replace.
Spawn an entity at a coordinate, remove one type without touching the rest, and put a title, subtitle or action bar on the screen.
/give @s command_block, a tour of the settings panel, and the gotcha that costs everyone an hour: inside a block, @s is the block — you want @p.
Once on a rising edge, once after the block pointing into it, or every tick forever. Direction matters — the arrow is the wiring.
The two switches that decide whether a block runs. Why chain blocks want Always Active, and why Always Active on an impulse block does nothing.
20 ticks is one second. Build then clear with no delay and the player sees nothing — this is the lesson that fixes the invisible build.
Dust, power and the three triggers, then a piston trap. Enough redstone to wire a map — not a redstone engineering course.
Four blocks in a row that teleport the player, fill a gold structure, clear the leftovers and say Good Job. Everything from B, working together.
A yes/no question about one coordinate. The command that turns a list of instructions into something that can be won or lost.
An impulse test followed by conditional chain blocks. Four blocks in the right places and the wall opens; one wrong and nothing happens.
Test for entities in an area instead of blocks — the check behind save-the-villager, survival timers and no-one-left-standing endings.
Every game needs a losing state and a way back. Hide the old entities, fill the structure back, summon fresh mobs.
Compare what the player built against a hidden answer copy, in all or masked mode. Pattern puzzles and shape locks in one command.
Chain delays into a 3-2-1, then run start, win and fail lines side by side in one map without them tripping over each other.
/scoreboard objectives add — a dummy objective is a variable, and setdisplay puts it on the sidebar or under the player's name.
Test a score before you act on it. Points for breaking the right block, a door that only opens at level 3, an NPC shop that takes payment.
Run from an entity's position and detect what is under it. The one command behind conveyor belts, mob sorters and trigger-free traps.
Education-edition NPCs with dialogue and command buttons, plus signboards, boards and slates. A map nobody can follow is not a game.
The Education-only blocks that stop a player wrecking your build, plus /gamemode adventure and the gamerules that make a map behave.
Potion effects for traps and power-ups, sound and particles so the player knows something happened, and checkpoints that survive dying.
A whole session on one map — parkour or escape room, checkpoints, traps, teleports and a winner title. Then export the world and play a classmate's.
A two-storey room built by command only, a testforblock door, a testforblocks pattern lock and a working restart line — then explain your command lines.