Gold stairs
Introduction
Climb higher and go for the gold! You will build some stairs out of gold blocks in this tutorial. The builder tool will do the work by placing gold blocks where you tell it to. You will build a golden stairway to the sky.
Step 1
Teleport the builder to your position.
The builder is similar to the agent but invisible.
# @highlight
builder.teleport_to(pos(0, 0, 0))
Step 2
To build a single stair, we tell the builder to move forward, then up, then forward, then up…
builder.teleport_to(pos(0, 0, 0))
# @highlight
builder.move(FORWARD, 1)
# @highlight
builder.move(UP, 1)
Step 3
Tell the builder to fill the path with gold blocks.
builder.teleport_to(pos(0, 0, 0))
builder.move(FORWARD, 1)
builder.move(UP, 1)
# @highlight
builder.trace_path(GOLD_BLOCK)
Step 4
Run the program and see what happens. You should see 3 new gold blocks appear.
Step 5
Repeat the builder’s actions 25
times to build 25 stairs.
builder.teleport_to(pos(0, 0, 0))
# @highlight
for i in range(25):
# @highlight
builder.move(FORWARD, 1)
# @highlight
builder.move(UP, 1)
builder.trace_path(GOLD_BLOCK)
Step 6
Run the program again. You should see a long gold block staircase get created.
Step 8
Teleport all players to the base of the stairs.
builder.teleport_to(pos(0, 0, 0))
for i in range(25):
builder.move(FORWARD, 1)
builder.move(UP, 1)
builder.trace_path(GOLD_BLOCK)
# @highlight
mobs.teleport_to_position(mobs.target(ALL_PLAYERS), pos(0, 0, 0))
Step 9
Set all players to creative mode.
builder.teleport_to(pos(0, 0, 0))
for i in range(25):
builder.move(FORWARD, 1)
builder.move(UP, 1)
builder.trace_path(GOLD_BLOCK)
mobs.teleport_to_position(mobs.target(ALL_PLAYERS), pos(0, 0, 0))
# @highlight
gameplay.set_game_mode(CREATIVE, mobs.target(ALL_PLAYERS))
Step 10
Now, run the program to build the stairs and start a game. The first player to the top wins!
builder