Minecraft Programming,
Launch Rocket in Minecraft
Abstract#
Builderの使い方の例として、ロケット描いてみます。
Topic#
自分のいる位置からX方向に10離れたところに、上の写真のロケットを作ります。本当は、GitHubに載せたい。 |
player.onChat("build", function () {
build_rocket(positions.groundPosition(pos(10, 0, 0)))
})
function build_rocket (pos2: Position) {
builder.teleportTo(pos2)
builder.move(BACK, 1)
builder.move(RIGHT, 1)
builder.mark()
builder.move(LEFT, 2)
builder.move(FORWARD, 2)
builder.move(RIGHT, 2)
builder.move(BACK, 2)
builder.tracePath(OBSIDIAN)
builder.move(BACK, 1)
builder.move(UP, 1)
for (let index5 = 0; index5 <= 20; index5++) {
builder.mark()
builder.move(LEFT, 2)
builder.move(FORWARD, 1)
builder.move(LEFT, 1)
builder.move(FORWARD, 2)
builder.move(RIGHT, 1)
builder.move(FORWARD, 1)
builder.move(RIGHT, 2)
builder.move(BACK, 1)
builder.move(RIGHT, 1)
builder.move(BACK, 2)
builder.move(LEFT, 1)
builder.move(BACK, 1)
builder.tracePath(IRON_BLOCK)
builder.move(UP, 1)
}
builder.move(FORWARD, 1)
builder.mark()
builder.move(LEFT, 2)
builder.move(FORWARD, 2)
builder.move(RIGHT, 2)
builder.move(BACK, 2)
builder.move(UP, 1)
builder.move(LEFT, 2)
builder.move(FORWARD, 2)
builder.move(RIGHT, 2)
builder.move(BACK, 1)
builder.move(LEFT, 1)
builder.move(UP, 2)
builder.tracePath(IRON_BLOCK)
}