Created
February 17, 2020 21:19
-
-
Save Xayer/ef748f3710b5ed03f845b1e159e0031e to your computer and use it in GitHub Desktop.
Minecraft tower builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
player.onChat("run", function (roofHeight) { | |
for (let index = 0; index <= 4; index++) { | |
builder.mark() | |
builder.move(FORWARD, roofHeight) | |
builder.raiseWall(POLISHED_ANDESITE, 5) | |
for (let index2 = 0; index2 < 2; index2++) { | |
builder.turn(RIGHT_TURN) | |
builder.move(FORWARD, 1) | |
} | |
builder.turn(RIGHT_TURN) | |
} | |
}) | |
function Roof (height: number, radius: number) { | |
builder.move(UP, 1) | |
for (let index = 0; index <= radius + 1; index++) { | |
for (let index2 = 0; index2 < index + 1; index2++) { | |
builder.setOrigin() | |
builder.move(UP, 1) | |
shapes.circle( | |
POLISHED_ANDESITE, | |
builder.position(), | |
radius - index, | |
Axis.Y, | |
ShapeOperation.Outline | |
) | |
} | |
} | |
} | |
player.onChat("tower", function (roofHeight, levels, roofRadius) { | |
builder.teleportTo(player.position()) | |
builder.setOrigin() | |
for (let index = 0; index < levels; index++) { | |
for (let index = 0; index < roofHeight - 1; index++) { | |
builder.setOrigin() | |
shapes.circle( | |
POLISHED_ANDESITE, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Outline | |
) | |
builder.move(UP, 1) | |
} | |
shapes.circle( | |
SPRUCE_WOOD_SLAB, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Replace | |
) | |
shapes.circle( | |
POLISHED_ANDESITE, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Outline | |
) | |
} | |
}) | |
player.onChat("roof", function (roofHeight, roofRadius) { | |
builder.teleportTo(player.position()) | |
builder.setOrigin() | |
Roof(roofHeight, roofRadius) | |
}) | |
player.onChat("clean", function (roofHeight, levels, roofRadius) { | |
builder.teleportTo(player.position()) | |
builder.setOrigin() | |
for (let index = 0; index < levels; index++) { | |
for (let index = 0; index < roofHeight - 1; index++) { | |
builder.setOrigin() | |
shapes.circle( | |
AIR, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Replace | |
) | |
builder.move(UP, 1) | |
} | |
shapes.circle( | |
AIR, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Replace | |
) | |
shapes.circle( | |
AIR, | |
builder.position(), | |
roofRadius, | |
Axis.Y, | |
ShapeOperation.Outline | |
) | |
builder.move(UP, 1) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment