1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/usr/bin/env python3
# mcpipy.com retrieved from URL below, written by Jason Milldrum, NT7S
# http://www.nt7s.com/blog/2013/02/exploring-minecraft-pi-edition/
import mcpi.minecraft as minecraft
import mcpi.block as block
import server
mc = minecraft.Minecraft.create(server.address)
radius = 8
mc.postToChat("Hello, here's your sphere")
playerPos = mc.player.getPos()
for x in range(radius*-1,radius):
for y in range(radius*-1, radius):
for z in range(radius*-1,radius):
if x**2 + y**2 + z**2 < radius**2:
mc.setBlock(playerPos.x + x, playerPos.y + y + radius, playerPos.z - z - 10, block.GLASS)
|