Skip to content

Instantly share code, notes, and snippets.

@hhachiya
Created March 17, 2019 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hhachiya/ed1f43efd44df5a7b4ffb5b504f3ddc9 to your computer and use it in GitHub Desktop.
Save hhachiya/ed1f43efd44df5a7b4ffb5b504f3ddc9 to your computer and use it in GitHub Desktop.
from mcpi.minecraft import Minecraft
from mcpi.block import *
import numpy as np
mc = Minecraft.create()
pos = mc.player.getTilePos()
r = 20
numBlocks = 150
for theta in np.arange(0,2*np.pi,2*np.pi/ numBlocks):
for phi in np.arange(0,2*np.pi,2*np.pi/ numBlocks):
mc.setBlock(pos.x + r * np.cos(phi) * np.cos(theta),pos.y + r * np.sin(phi),pos.z + r * np.cos(phi) * np.sin(theta),1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment