Introduction
15 minYou have built a house you can drop anywhere. Now build a street of them without writing the house again.
Copy and paste, for the world
The Blocks drawer has a block called clone. It takes a region of the world that already exists — walls, windows, furniture, everything — and stamps an exact copy of it somewhere else.
It needs three positions, and the first two you already know:
| Position | What it means |
|---|---|
| begin | one corner of the thing you want to copy |
| end | the opposite corner — same idea as a fill |
| destination | where the copy's first corner lands |
begin and end describe a box, exactly as they do in a fill. The difference is that fill invents blocks and clone duplicates the ones already there.
Why this changes what you can build
Up to now, a village of ten houses meant a program ten times as long, or a loop that rebuilt the house from scratch ten times over.
With clone you build one house, by hand or by program, as carefully as you like — and then copy it. The second house costs one block of program. So does the tenth.
That is a different way of working: build once, place many.
Two settings that matter
The clone block ends with two dropdowns, and the defaults are usually right — but not always.
The mask decides what happens to air in the region you are copying:
- replace — copy everything, including the empty space. The destination is wiped and replaced exactly.
- masked — copy only the solid blocks and leave the destination's own blocks showing through the gaps. Use this to lay something on top of what is already there.
The mode decides what happens to the original:
- normal — the original stays put.
- move — the original is removed, leaving air. The building is transported rather than copied.
⚠️ Mobs do not come with it
Clone copies blocks. The cows in your pen, the fish in your tank and every other living thing stay exactly where they are.
So a cloned farm arrives empty, and you have to spawn its animals again — which is why this lesson comes after Lesson 9 and not before.
Warm-up — the photocopier
Nobody writes a worksheet thirty times. They write it once and press the button thirty times.
The interesting question is not how to copy. It is what is worth building well enough to copy — and that is the question this lesson is really about.
What you will be able to do
- Copy a region of the world to somewhere else with one block.
- Build a row of identical buildings with a loop and a growing offset.
- Choose between replace and masked, and say why.
- Keep a safe copy of a build and restore it after it is damaged.
Basic
20 minFollow along on your own computer. Everyone should finish this part with the same working build.
Step 1 — Build something worth copying
Run your house command from Lesson 8, standing somewhere clear and flat. Note your three numbers before you run it, so you know exactly where the house begins.
A house from ~0 ~-1 ~0 to ~9 ~5 ~9 occupies a box ten blocks wide, ten deep and seven tall, counting the foundation.
Step 2 — Copy it once
Start a new chat command called copy. The clone block is in the Blocks drawer.
Stand where you stood when you built the house, and type copy.
A second house appears fifteen blocks to the east, identical down to the window band and the doorway.
Step 3 — Read the three positions
~0 ~-1 ~0and~9 ~5 ~9are the corners of the house you already built — the same two corners you filled it with.~15 ~-1 ~0is where the copy's first corner goes.
The copy keeps its shape and its orientation. It is not rotated, not resized, and not centred on the destination — the destination is simply where its corner lands.
⚠️ Leave room. Destination ~5 ~-1 ~0 would overlap the original, and the clone refuses to run rather than eat itself.
Step 4 — Now a whole street
One copy is a copy. Five is a street — and you already know how to do something five times.
Type street. Five more houses march away east, each fifteen blocks past the last.
Challenge 1
15 minBuild one, get two.
- Stand somewhere clear and flat and run your
housecommand from Lesson 8. - Write down the two corners the house occupies, including its foundation.
- Press
Cand start a new chat command calledtwin. - With one clone block, make an exact copy of the house standing beside the first, with a gap of at least 3 blocks between them.
- Type
twin, then walk into both houses.
If nothing happens at all, your destination is too close and the two boxes overlap.
It works if: two identical houses stand side by side with a clear gap between them, and both have a door you can walk through and windows you can see daylight through.
Challenge 2
20 minA street.
Five houses from one, without writing the house again.
- Press
Cand start a new chat command calledstreet. - Using a loop and a variable, clone your house five times in a row, each one a fixed distance past the last.
- The houses must not overlap and must not leave ragged gaps — choose the spacing from the width of the house.
- Type
street, then walk from the first house to the last along the front of them. - Now change the number of houses to eight by editing one number, and run it again.
It works if: five evenly spaced identical houses stand in a line, then eight of them after a single edit, and every one of them can be walked into.
Challenge 3
25 minA village with a square.
A street is a line. A village is a plan.
- Press
Cand start a new chat command calledvillage. - Build or reuse two different buildings — they must not be the same shape.
- Arrange at least six buildings using clone, in something other than a single straight line: a square with a green in the middle, two facing rows, an L, a courtyard — your choice.
- At least one building must appear more than once, and both designs must appear at least twice.
- Nothing may overlap anything else.
- Type
village, then walk through it.
Plan the positions on squared paper before you type. Six clone destinations guessed at will take longer than six worked out.
It works if: six or more buildings stand in a deliberate arrangement that is not one straight line, both designs are used at least twice, nothing overlaps, and you can walk between them all without climbing.
Extra challenge
spare timeThe master copy.
Make your village repairable.
- Build a house you are happy with.
- Press
Cand write a command calledbackupthat clones the house to somewhere far out of the way — a hundred blocks up is ideal, where nothing will disturb it. - Write a second command called
restorethat clones the master copy back down over the house. - Now damage the house on purpose. Blow a hole in a wall with an air fill, or delete the roof.
- Type
restore.
It works if: after wrecking part of the house and typing restore, the house is exactly as it was — and the master copy a hundred blocks up is still there, untouched, ready to be used again.
Why this is worth keeping
You have just written the first thing in this course that protects you from yourself.
Every program so far has built something. These two build nothing new — they make a copy and put it back. That is a different kind of usefulness, and it is why professional builders of all kinds keep a version of their work from before they started changing it.
Keep backup and restore. The next lesson but one is a project where something you build will get broken, and you will be very glad of them.