Created
May 2, 2016 13:57
-
-
Save hamukazu/e5514bd9ccb38ed991bd76b797aad854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"This program makes a cone in Minecraft" | |
import mcpi | |
import mcpi.block | |
import mcpi.minecraft | |
import numpy as np | |
def disk(mc, cx, cy, cz, r): | |
for i in range(0, 360, 1): | |
dx = r * np.cos(i * np.pi / 180) | |
dz = r * np.sin(i * np.pi / 180) | |
mc.setBlock(cx + dx, cy, cz + dz, mcpi.block.WOOL) | |
def main(): | |
mc = mcpi.minecraft.Minecraft() | |
x, y, z = mc.player.getPos() | |
cx, cy, cz = x + 50, y, z + 50 | |
for i in range(30): | |
r = 30 - i | |
disk(mc, cx, cy + i, cz, r) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment