Sphere Script…

Below is a script from Jason Milldrum, NT7S which creates a sphere in Minecraft!  First the pic…

then the code…

import minecraft.minecraft as minecraft
import minecraft.block as block

mc = minecraft.Minecraft.create()

mc.postToChat("Hallo, here's your sphere")

radius = 6

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.GOLD_BLOCK)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s