Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mcpi import minecraft
- from mcpi import block
- import math
- mc = minecraft.Minecraft.create()
- playerPos = mc.player.getPos()#現在位置
- x_offset = 1 #現在位置のx座標からのオフセット
- y_offset = 0 #現在位置のy座標からのオフセット
- z_offset = 1 #現在位置のz座標からのオフセット
- square_width_half =4 #アーチの半分の長さ
- #ブロックを設置する開始位置
- pos_x = int(math.floor(playerPos.x))+x_offset
- pos_y = int(math.floor(playerPos.y))+y_offset
- pos_z = int(math.floor(playerPos.z))+z_offset
- #アーチを設置
- for x in xrange(pos_x-square_width_half,pos_x+square_width_half):
- for y in xrange(pos_y,pos_y+square_width_half):
- for z in xrange(pos_z-square_width_half,pos_z+square_width_half):
- if y <= pos_y+square_width_half:
- if z == pos_z-square_width_half or z==pos_z+square_width_half-1:
- mc.setBlock(x,y,z,block.STONE)
- else:
- mc.setBlock(x,y,z,block.STONE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement