-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmcni.py
48 lines (37 loc) · 1.42 KB
/
mcni.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Northern Ireland Raspbery Jam Libary for Advanced Minecraft Projects 1.0
from mcpi import minecraft
mc = minecraft.Minecraft.create("")
import mcpi.block as block
import mcpi.minecraft as minecraft
import random
def printTree(t):
while t>0:
x=random.randint(-60, 60)
y=1
z=random.randint(-60, 60)
mc.setBlocks(x+1, y, z, x+1, y+4, z, 17)
mc.setBlocks(x+2, y+2, z+1, x, y+3, z-1, 18)
mc.setBlocks(x+1, y+2, z, x+1, y+4, z, 18)
mc.setBlocks(x, y+3, z-1, x, y+3, z-1, 0)
mc.setBlocks(x, y+3, z+1, x, y+3, z+1, 0)
mc.setBlocks(x+2, y+3, z-1, x+2, y+4, z-1, 0)
mc.setBlocks(x+2, y+3, z+1, x+2, y+4, z+1, 0)
t=t-1
def drawSphere(mc, x1, y1, z1, radius, blocktype, blockdata=0):
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 and (x**2 + y**2 +z**2 > (radius-2)**2)):
mc.setBlock(x1 + x, y1 + y, z1 +z, blocktype, blockdata)
def printBlockOnce(block)
x, y, z = mc.player.getPos()
mc.setBlock(x+3, y+3, z, block)
def printBlockForever(block)
while True:
x, y, z = mc.player.getPos()
mc.setBlock(x+3, y+3, z, block)
def printBlockForT(t,block)
while t>0:
x, y, z = mc.player.getPos()
mc.setBlock(x+3, y+3, z, block)
t = t-1