ビルダーで構造物として保存する builder.saveStructure
ひとことで言うと
「構造物の建築を開始する」を呼び出した後に建築したものを構造物として保存する。
ブロックとコード
ビルダー:"my structure"という名前の構造物として保存する エンティティを含む:false空気をないものとして扱う:○
ブロックの文言は公式の日本語版に合わせています(形は簡易表示です)。
builder.saveStructure("my structure", false)builder.save_structure("my structure", False)引数(ひきすう)
引数とは、ブロックの中で自分で選んだり入力したりする部分のことです。
| 名前 | 選べる値 | 意味 |
|---|---|---|
| name | 文字列 | |
| includeEntities | 真偽値(true / false) | |
| replaceAirWithVoid | 真偽値(true / false) |
使用例
This example constructs a 3x3x3 cube with random colors of concrete as a structure and then pastes that structure to create an even bigger cube.
JavaScript
player.onChat("cube", function () {
builder.teleportTo(pos(0, 0, 0))
builder.move(FORWARD, 5)
builder.setOrigin()
builder.startStructure()
for (let index = 0; index < 3; index++) {
for (let index = 0; index < 3; index++) {
for (let index = 0; index < 3; index++) {
builder.place([
LIGHT_BLUE_CONCRETE,
LIME_CONCRETE,
PINK_CONCRETE,
ORANGE_CONCRETE
]._pickRandom())
builder.move(FORWARD, 1)
}
builder.move(RIGHT, 1)
builder.move(BACK, 3)
}
builder.move(LEFT, 3)
builder.move(UP, 1)
}
builder.saveStructure("cube")
builder.teleportToOrigin()
builder.move(FORWARD, 10)
builder.move(LEFT, 4)
for (let index = 0; index < 3; index++) {
for (let index = 0; index < 3; index++) {
for (let index = 0; index < 3; index++) {
builder.loadStructure("cube")
builder.move(FORWARD, 4)
}
builder.move(RIGHT, 4)
builder.move(BACK, 12)
}
builder.move(LEFT, 12)
builder.move(UP, 4)
}
})Python
def on_on_chat():
builder.teleport_to(pos(0, 0, 0))
builder.move(FORWARD, 5)
builder.set_origin()
builder.start_structure()
for index in range(3):
for index2 in range(3):
for index3 in range(3):
builder.place([LIGHT_BLUE_CONCRETE,
LIME_CONCRETE,
PINK_CONCRETE,
ORANGE_CONCRETE]._pick_random())
builder.move(FORWARD, 1)
builder.move(RIGHT, 1)
builder.move(BACK, 3)
builder.move(LEFT, 3)
builder.move(UP, 1)
builder.save_structure("cube")
builder.teleport_to_origin()
builder.move(FORWARD, 10)
builder.move(LEFT, 4)
for index4 in range(3):
for index5 in range(3):
for index6 in range(3):
builder.load_structure("cube")
builder.move(FORWARD, 4)
builder.move(RIGHT, 4)
builder.move(BACK, 12)
builder.move(LEFT, 12)
builder.move(UP, 4)
player.on_chat("cube", on_on_chat)