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.

Stairs made of solid gold

Step 1

Put in an ||player:on chat command|| and rename it to goldstairs.

player.onChat("goldstairs", function () {
})

Step 2

Insert a ||builder:builder teleport to|| into the chat command to teleport the player to your position.

The builder is similar to the agent but invisible.

player.onChat("goldstairs", function () {
    builder.teleportTo(pos(0, 0, 0))
})

Step 3

Put two ||builder:builder move|| below ||builder:builder teleport to|| to move forward and up.

To build a single stair, we tell the builder to move forward, then up, then forward, then up…

player.onChat("goldstairs", function () {
    builder.teleportTo(pos(0, 0, 0))
    builder.move(FORWARD, 1)
    builder.move(UP, 1)
})

Step 4

Add a ||builder:builder trace path|| to tell the builder to fill the path with gold blocks.

player.onChat("goldstairs", function () {
    builder.teleportTo(pos(0, 0, 0))
    builder.move(FORWARD, 1)
    builder.move(UP, 1)
    builder.tracePath(GOLD_BLOCK)
})

Step 5

Go to Minecraft, type t to open the chat and enter goldstairs. You should see 3 new gold blocks appear.

Step 6

Now, get a ||loops:repeat|| loop with 25 times and put it around all of the ||builder:builder move|| to build 25 stairs.

player.onChat("goldstairs", function () {
    builder.teleportTo(pos(0, 0, 0))
    for (let i = 0; i < 25; i++) {
        builder.move(FORWARD, 1)
        builder.move(UP, 1)
    }
    builder.tracePath(GOLD_BLOCK)
})

Step 7

Go to Minecraft and enter goldstairs in the chat. You should see a long gold block staircase get created.

Step 8

Add in a ||mobs:teleport to position|| to teleport all players to the base of the stairs.

    mobs.teleportToPosition(
        mobs.target(ALL_PLAYERS),
        pos(0, 0, 0)
    )

Step 9

Add a ||gameplay:set game mode|| at the end to switch all players to creative mode.

    gameplay.setGameMode(
        CREATIVE,
        mobs.target(ALL_PLAYERS)
    )

Step 10

Go to Minecraft and enter goldstairs in the chat. The first player to the top wins!

builder