Пример #1
0
def buld_platform(x, y, z):
    mc = Minecraft.create()
    mc.setBlocks(x - 4, y, z - 4, x + 4, y, z + 4, 'glass')
Пример #2
0
from minecraft import Minecraft
import block
import time

mc = Minecraft.create(address='192.168.0.17')
mc.saveCheckpoint()

types = {
    ' ': block.AIR,
    'x': block.STONE
}
pattern = """
x     x  x     x  
xx   xx   x   x
x x x x    x x
x  x  x     x
""".split('\n')


def get_type(row, col):
    c = (col + offset) % width
    if 0 <= row < len(pattern):
        if 0 <= c < len(pattern[row]):
            return types[pattern[row][c]]
    return block.AIR

width = max(len(x) for x in pattern)
height = len(pattern)

center_x, center_y, center_z = mc.player.getTilePos()
Пример #3
0
from minecraft import Minecraft
mc = Minecraft.create()

mc.player.setTilePos(10, 100, 10)
pos = mc.player.getPos()
x = pos.x
y = pos.y
z = pos.z
cobblestone = 4
mc.setBlocks(x, y, z, x+10, y+10, z+10, cobblestone)
air = 0
        return
    hit = hits.pop()
    v = hit.pos

    # Place the structure at the chosen location. The position is calculated by
    # taking a block's orginal location, subtracting the minimum position
    # vector of the bounding box and adding the position vector of the chosen
    # location.

    for block in structure:
        pos = block[0] - Vec3(minx, miny, minz) + Vec3(v.x, v.y+1, v.z)
        mc.setBlock(pos, block[1])
    
              
if __name__ == "__main__":
    mc = Minecraft.create()
    mc.postToChat("InteractiveMinecraft working!")
    
    flag = True
    while flag:
        x = raw_input("Enter your command or type 'help' " + 
            "to see a list of available commands.\n:> ")
        if x.lower() == "copy":
            copy()
        elif x.lower() == "quit":
            flag = False
        elif x.lower() == "help":
            print "Todo!"


Пример #5
0
def main():
	m = Minecraft.create()
	m.postToChat("You'll never walk alone!")
	trackPlayer(m)
	return 0