Python

for x in range(-100,100):
for z in range(-100,100):
mc.setBlock(x,3,z,2)
print (z)

for x in range(0,20):
for y in range(4,10):
for z in range(0,20):
if(x==y):
mc.setBlock(x,y,z,128)
print (y)

for x in range(20,30):
for y in range(4,10):
for z in range(0,20):
if(x-20==y):
mc.setBlock(x,y,z,128)
print (y)

Python For If

for x in range(78,86):
for z in range(-17,-9):
for y in range(4,24):
a=mc.getBlock(x,y,z)
if (a!=0):
mc.setBlock(x,y,z,41)
print (a)

for x in range(-150,0,10):
for y in range(0,100,10):
for z in range(-150,0,10):
mcdrawing.drawSphere(x,y,z,6,41);
print (z)

Python getBlock setBlock

import mcpi.minecraft as minecraft
import mcpi.minecraftstuff as minecraftstuff
import mcpi.block as block
mc = minecraft.Minecraft.create()
mcdrawing = minecraftstuff.MinecraftDrawing(mc)
mc.setBlock(430,30,128,1)
for y in range(0,30):
a=mc.getBlock(430,y,128)
print (a)

Instructiunea FOR

import mcpi.minecraft as minecraft

import mcpi.minecraftstuff as minecraftstuff

mc = minecraft.Minecraft.create()

mcdrawing = minecraftstuff.MinecraftDrawing(mc)

for x in range(120, 200,10):

print(x)
mcdrawing.drawCylinder(x,4,-75,1,10,49,48)

Lectia 4 Recapitulare

drawSphere(x,y,z,mărimea sferei,material)
drawLine(x1,y1,z1,x2,y2,z2,material)
drawSlicedHollow(x1,y1,z1,mărimea,material 1,material2)
drawDome(x,y,z,mărimea sferei din care creăm cupola, cât tăiem din sferă,material1, material 2)
drawChessDome(x,y,z,mărimea sferei din care creăm cupola, cât tăiem din sferă,material1, material 2)
drawWall(x,y,z,direcția zidului, înălțimea, lungimea,material1,material2)
drawChessWall(x,y,z,direcția zidului, înălțimea, lungimea,material1,material2)
drawFloor(x1,y1,z1,x2,y2,z2,material1,material2)
drawChessFloor(x1,y1,z1,x2,y2,z2,material1,material2)
drawCone(x1,y1,z1,înălțimea, material1, material2)
drawCylinder(x1,y1,z1,grosimea,înălțimea,material1,material2)