def build_tower():
x, y, z = 10, -60, 0
base_size = 100
base_height = 70
mid_height = 40
top_height = 90
for level in range(base_height):
size = base_size - (level * 2)
for i in range(size):
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + level + i, y + level, z + level), pos(x + level + i, y + level, z + level + size - 1), FillOperation.Replace)
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + level, y + level, z + level + i), pos(x + level + size - 1, y + level, z + level + i), FillOperation.Replace)
for level in range(mid_height):
size = base_size - 2 * base_height - (level * 2)
for i in range(size):
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + base_height + level + i, y + base_height + level, z + base_height + level), pos(x + base_height + level + i, y + base_height + level, z + base_height + level + size - 1), FillOperation.Replace)
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + base_height + level, y + base_height + level, z + base_height + level + i), pos(x + base_height + level + size - 1, y + base_height + level, z + base_height + level + i), FillOperation.Replace)
for level in range(top_height):
size = base_size - 2 * base_height - 2 * mid_height - (level * 2)
for i in range(size):
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + base_height + mid_height + level + i, y + base_height + mid_height + level, z + base_height + mid_height + level), pos(x + base_height + mid_height + level + i, y + base_height + mid_height + level, z + base_height + mid_height + level + size - 1), FillOperation.Replace)
blocks.fill(PILLAR_QUARTZ_BLOCK, pos(x + base_height + mid_height + level, y + base_height + mid_height + level, z + base_height + mid_height + level + i), pos(x + base_height + mid_height + level + size - 1, y + base_height + mid_height + level, z + base_height + mid_height + level + i), FillOperation.Replace)
def on_chat(command):
if command == “build_tower”:
build_tower()
player.on_chat(“build_tower”, on_chat)
this python code have a error says “Requires 1 argument, takes 0”
finish my codes and please specify the location using pos please.
New contributor
박성재 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.