JyCraft

from org.bukkit import Bukkit
from org.bukkit import Location
from org.bukkit.util import Vector
from org.bukkit.entity import EntityType
from org.bukkit.entity import Snowball
from org.bukkit.entity import *
from org.bukkit.projectiles import *
from time import *
from org.bukkit import Effect
from mcapi_spigot import *
from org.bukkit.event.block import BlockPlaceEvent
s = Bukkit.getServer()
players=Bukkit.getOnlinePlayers()
player=players[0]
loc=player.getLocation()
w=player.getLocation().getWorld()
x1=int(loc.x)
z1=int(loc.z)
i=1
for x in range(x1,x1+20):
for z in range(z1,z1+10):
setblock(x, 4, z, Material.values()[i])
i=i+1
print i

ent=w.getEntities()
nr=0
for e in ent:
e.remove()
nr=nr+1
print nr

nr=0
for p in players:
print p.getLocation().distance(loc)
nr=nr+1
print nr

nr=0
min=1000
entnr=0
for e in ent:
dist= e.getLocation().distance(loc)
if dist

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)

Jycraft 2017 Lectia 1

from org.bukkit import Bukkit
from org.bukkit import Location
from org.bukkit.util import Vector
from org.bukkit.entity import EntityType
from org.bukkit.entity import Snowball
from org.bukkit.entity import *
from org.bukkit.projectiles import *
from time import *
from org.bukkit import Effect
from mcapi_spigot import *
from org.bukkit.event.block import BlockPlaceEvent
s = Bukkit.getServer()
players=Bukkit.getOnlinePlayers()
player=players[0]
loc=player.getLocation()
w=player.getLocation().getWorld()
def build(e):
pos=e.getBlockPlaced().getLocation()
for i in range(-5,5):
for j in range(-5,5):
setblock(pos.x-i, pos.y, pos.z-j, Material.COBBLESTONE)
unregister_hooks()
register_hook(BlockPlaceEvent, build)

if (e.getBlockPlaced().getType()==Material.COBBLESTONE):
yell( “salut”)
drawCircle(lookingat(player),Material.COBBLESTONE,5)
drawHorizCircle(pos,e.getBlockPlaced().getType(),5)