Advertisement
Guest User

Untitled

a guest
Jun 29th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. from mcpi import minecraft
  2. from mcpi import block
  3. import math
  4. mc = minecraft.Minecraft.create()
  5. playerPos = mc.player.getPos()#現在位置
  6. x_offset = 1 #現在位置のx座標からのオフセット
  7. y_offset = 0 #現在位置のy座標からのオフセット
  8. z_offset = 1 #現在位置のz座標からのオフセット
  9. square_width_half =4 #アーチの半分の長さ
  10.  
  11. #ブロックを設置する開始位置
  12. pos_x = int(math.floor(playerPos.x))+x_offset
  13. pos_y = int(math.floor(playerPos.y))+y_offset
  14. pos_z = int(math.floor(playerPos.z))+z_offset
  15.  
  16. #アーチを設置
  17. for x in xrange(pos_x-square_width_half,pos_x+square_width_half):
  18. for y in xrange(pos_y,pos_y+square_width_half):
  19. for z in xrange(pos_z-square_width_half,pos_z+square_width_half):
  20. if y <= pos_y+square_width_half:
  21. if z == pos_z-square_width_half or z==pos_z+square_width_half-1:
  22. mc.setBlock(x,y,z,block.STONE)
  23. else:
  24. mc.setBlock(x,y,z,block.STONE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement