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.
Teleport the builder
Teleport the builder to your position.
The builder is similar to the agent but invisible.
# @highlight
builder.teleport_to(pos(0, 0, 0))
Build a stair step
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)
Make the stair with Gold
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)
Try it!
Run the program and see what happens. You should see 3 new gold blocks appear.
Make a whole staircase
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)
Try it again
Run the program again. You should see a long gold block staircase get created.
Bring the players to the stairs
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))
Set Creative Mode
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))
Play your stair game!
Now, run the program to build the stairs and start a game. The first player to the top wins!
builder