https://pastein.ru/t/F5V

  скопируйте уникальную ссылку для отправки

Загрузка данных


import collections
import time

from mcpi.minecraft import Minecraft
from collections.abc import Iterable

collections.Iterable = Iterable

mc = Minecraft.create()


def calculateMove():
    global x
    global y
    global z

    currentHeight = mc.getHeight(x, y) - 1
    forwardHeight = mc.getHeight(x + 1, z)
    rightHeight = mc.getHeight(x, z + 1)
    backHeight = mc.getHeight(x - 1, z)
    leftHeight = mc.getHeight(x, z - 1)
    if forwardHeight - currentHeight < 3:
        x += 1
    elif rightHeight - currentHeight < 3:
        z += 1
    elif leftHeight - currentHeight < 3:
        z -= 1
    elif backHeight - currentHeight < 3:
        x -= 1
    y = mc.getHeight(x, z)


pos = mc.player.getTilePos()
x = pos.x
y = mc.getHeight(x, z)
z = pos.z

while True:
    calculateMove()
    mc.setBlocks(x, y, z, 103)
    time.sleep(1)
    mc.setBlocks(x, y, z, 0)