Reference

The command language

Eight little commands build any block world. The world is a grid: every spot is three numbers — across, forward, up — from 0 to 31. Programs run top to bottom, one line at a time. Back to the labs anytime: Open the console →

  • set set <block> <x y z>

    Place one block at a spot. The three numbers are across, forward, and up.

    set lantern 3 3 0
  • ~ (relative) set <block> ~0 ~0 ~1

    ~ means “relative to the cursor”. ~0 ~0 ~1 is “same across, same forward, one up” — so you never have to know the cursor’s number.

    set lantern ~0 ~0 ~1
  • move move <dx dy dz>

    Slide the cursor. move ~1 ~0 ~0 steps one block east; move 6 2 0 jumps to an exact spot.

    move ~0 ~0 ~1
  • repeat repeat <n> { … }

    Run the block inside the braces n times — the loop does the copy-paste for you.

    repeat 4 {
      set stone ~0 ~0 ~0
      move ~0 ~0 ~1
    }
  • define define <name> { … }

    Teach the console a brand-new word. Afterwards you can say that word as many times as you like.

    define pillar {
      repeat 3 { set stone ~0 ~0 ~0
      move ~0 ~0 ~1 }
    }
    move 2 2 0
    pillar
  • define(…) with a number define <name>(h) { … }

    A word that takes a number. Use h inside wherever the number goes, then call it with a value.

    define tower(h) {
      repeat h { set stone ~0 ~0 ~0
      move ~0 ~0 ~1 }
    }
    tower(5)
  • paint + @query paint <block> @<kind>[within=<n>]

    Ask the world for every block of a kind within n of the cursor, and recolour them all at once. Anything farther is skipped.

    paint lantern_lit @lantern[within=3]
  • when … do when <condition> do <command>

    Run the command only if the condition is true (like night). The same program does nothing when it is false.

    when night do paint lantern_lit @lantern[within=5]

Tip: a wrong run is the fastest way to learn — the console tells you the exact line and what to fix. Try a lab →