from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
sand = 12
sandState = 1
x = pos.x +1
y = pos.y
z = pos.z
floor = int(input("How many floors of pyramids do we make?"))
width = floor * 2 - 1
for i in range(floor):
mc.setBlocks(x+i, y+i, z+i, x+width-1+i, y+i, z+width-1-i, sand, sandState)
width = width - 2
The position is based on the minecraft player.
The material used is sand.
You must input the numbers of the layer of pyramid.
The width would be 2 times floor minus 1.
In the range of the floor, set blocks with sand. x, z will be the horizontal and vertical sides of a plane and y will be the height of a plane.