https://pastein.ru/t/CIV

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


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

import time
import random
import collections
import mcpi.block as block

collections.Iterable = Iterable

mc = Minecraft.create()
pos = mc.player.getTilePos()

x = pos.x + 1
y = pos.y
z = pos.z


def avto1(x, y, z):
    mc.setBlocks(x, y, z, x + 1, y + 2, z + 4, 5)
    mc.setBlocks(x, y + 1, z, x + 1, y + 2, z, 0)
    mc.setBlocks(x, y + 1, z + 2, x + 1, y + 1, z + 2, 0)
    mc.setBlocks(x, y + 1, z + 4, x + 1, y + 2, z + 4, 0)


def avto2(x, y, z):
    mc.setBlocks(x, y, z, x + 4, y + 2, z + 1, 5)
    mc.setBlocks(x, y + 1, z, x, y + 2, z + 1, 0)
    mc.setBlocks(x + 2, y + 1, z, x + 2, y + 1, z + 1, 0)
    mc.setBlocks(x + 4, y + 1, z, x + 4, y + 2, z + 1, 0)


def dom_N(x, y, z):
    sx = x + 2 + 5 / 2  # центр по X

    sy = y + 5 / 2  # центр по Y

    sz = z + 5 / 2  # центр по Z

    mc.setBlocks(x + 1, y, z, x + 6, y + 5, z + 5, block.GOLD_BLOCK.id)

    mc.setBlocks(x + 2, y + 1, z + 1, x + 5, y + 4, z + 4, block.AIR.id)

    mc.setBlocks(sx - 1, y + 1, z, sx, y + 2, z, block.AIR.id)

    mc.setBlocks(sx + 1, sy + 1, z, sx + 1, sy + 2, z, block.GLASS.id)

    mc.setBlocks(sx - 2, sy + 1, z, sx - 2, sy + 2, z, block.GLASS.id)

    mc.setBlocks(x + 1, sy + 1, sz + 2, x + 1, sy + 2, sz + 2, block.GLASS.id)

    mc.setBlocks(x + 1, sy + 1, sz - 1, x + 1, sy + 2, sz - 1, block.GLASS.id)

    mc.setBlocks(x + 6, sy + 1, sz + 2, x + 6, sy + 2, sz + 2, block.GLASS.id)

    mc.setBlocks(x + 6, sy + 1, sz - 1, x + 6, sy + 2, sz - 1, block.GLASS.id)

    mc.setBlocks(x + 1, y + 6, z, x + 6, y + 6, z + 5, block.IRON_BLOCK.id)
    mc.setBlocks(x + 2, y + 7, z, x + 5, y + 7, z + 5, block.IRON_BLOCK.id)
    mc.setBlocks(x + 3, y + 8, z, x + 4, y + 8, z + 5, block.IRON_BLOCK.id)


mc.setBlocks(pos.x - 2, pos.y, pos.z - 2, pos.x + 22, pos.y + 3, pos.z + 76, block.IRON_BLOCK.id)
mc.setBlocks(pos.x - 1, pos.y, pos.z - 1, pos.x + 21, pos.y + 3, pos.z + 75, 0)
mc.setBlocks(pos.x - 1, pos.y - 1, pos.z + 50, pos.x + 21, pos.y - 1, pos.z + 51, 10)

# Создаём пьедестал к кубку
mc.setBlocks(pos.x + 5, pos.y + 1, pos.z + 70, pos.x + 15, pos.y + 1, pos.z + 75, 57)

# Создаём кубок
mc.setBlocks(pos.x + 8, pos.y + 2, pos.z + 72, pos.x + 12, pos.y + 2, pos.z + 72, 89)
mc.setBlocks(pos.x + 10, pos.y + 2, pos.z + 72, pos.x + 10, pos.y + 4, pos.z + 72, 89)
mc.setBlocks(pos.x + 8, pos.y + 5, pos.z + 72, pos.x + 12, pos.y + 5, pos.z + 72, 89)
mc.setBlocks(pos.x + 7, pos.y + 6, pos.z + 72, pos.x + 13, pos.y + 6, pos.z + 72, 89)
mc.setBlocks(pos.x + 6, pos.y + 7, pos.z + 72, pos.x + 14, pos.y + 7, pos.z + 72, 89)
mc.setBlocks(pos.x + 6, pos.y + 8, pos.z + 72, pos.x + 14, pos.y + 8, pos.z + 72, 89)
mc.setBlocks(pos.x + 6, pos.y + 9, pos.z + 72, pos.x + 14, pos.y + 9, pos.z + 72, 89)

z = z + 5
z1 = pos.z + 20
z2 = pos.z + 40
x1 = pos.x + 15
x11 = pos.x + 5
x22 = pos.x + 10
z11 = pos.z + 10
z22 = pos.z + 30
y11 = pos.y + 12
y22 = pos.y

x33 = pos.x
z33 = pos.z
while True:
    pos = mc.player.getTilePos()
    for i in range(8):
        pos = mc.player.getPos()
        for i in range(5):
            if mc.getBlock(pos.x - i, pos.y, pos.z) == 5 or mc.getBlock(pos.x + i, pos.y, pos.z) == 5:
                mc.player.setTilePos(x33, y, z33)
                mc.postToChat("Вы проиграли, начните заново")

        if mc.getBlock(pos.x, pos.y - 1, pos.z) == 11:
            mc.player.setTilePos(x33, y, z33)
            mc.postToChat("Вы проиграли, начните заново")

        elif mc.getBlock(pos.x - 1, pos.y, pos.z) == 89 or mc.getBlock(pos.x + 1, pos.y,
                                                                       pos.z) == 89 or mc.getBlock(pos.x,
                                                                                                   pos.y,
                                                                                                   pos.z - 1) == 89 or mc.getBlock(
                pos.x, pos.y, pos.z + 1) == 89:
            mc.postToChat("Вы ПОБЕДИЛИ")
        for i in range(10):
            if mc.getBlock(pos.x, pos.y + i, pos.z) == 41:
                mc.player.setTilePos(x33, y, z33)
                mc.postToChat("Вы проиграли, начните заново")

        avto2(x, y, z)
        avto2(x1, y, z1)
        avto2(x, y, z2)

        dom_N(x11, y11, z11)
        dom_N(x22, y22, z22)

        x = x + 2
        x1 = x1 - 2
        y11 = y11 - 1
        y22 = y22 + 1

        time.sleep(0.5)
        mc.setBlocks(x - 5, y, z, x, y + 2, z + 1, 0)
        mc.setBlocks(x1, y, z1, x1 + 10, y + 2, z1 + 1, 0)
        mc.setBlocks(x - 5, y, z2, x, y + 2, z2 + 1, 0)

        mc.setBlocks(x11, y11 + 10, z11, x11 + 6, y11, z11 + 5, 0)
        mc.setBlocks(x22, y22 - 1, z22, x22 + 6, y22, z22 + 5, 0)

    for i in range(8):
        pos = mc.player.getTilePos()

        for i in range(5):
            if mc.getBlock(pos.x - i, pos.y, pos.z) == 5 or mc.getBlock(pos.x + i, pos.y, pos.z) == 5:
                mc.player.setTilePos(x33, y, z33)
                mc.postToChat("Вы проиграли, начните заново")

        if mc.getBlock(pos.x, pos.y - 1, pos.z) == 11:
            mc.player.setTilePos(x33, y, z33)
            mc.postToChat("Вы проиграли, начните заново")

        elif mc.getBlock(pos.x - 1, pos.y, pos.z) == 89 or mc.getBlock(pos.x + 1, pos.y,
                                                                       pos.z) == 89 or mc.getBlock(pos.x,
                                                                                                   pos.y,
                                                                                                   pos.z - 1) == 89 or mc.getBlock(
                pos.x, pos.y, pos.z + 1) == 89:
            mc.postToChat("Вы ПОБЕДИЛИ")
        for i in range(10):
            if mc.getBlock(pos.x, pos.y + i, pos.z) == 41:
                mc.player.setTilePos(x33, y, z33)
                mc.postToChat("Вы проиграли, начните заново")

        avto2(x, y, z)
        avto2(x1, y, z1)
        avto2(x, y, z2)

        dom_N(x11, y11, z11)
        dom_N(x22, y22, z22)

        x = x - 2
        x1 = x1 + 2

        y11 = y11 + 1
        y22 = y22 - 1

        time.sleep(0.5)
        mc.setBlocks(x, y, z, x + 10, y + 2, z + 1, 0)
        mc.setBlocks(x1 - 5, y, z1, x1, y + 2, z1 + 1, 0)
        mc.setBlocks(x, y, z2, x + 10, y + 2, z2 + 1, 0)

        mc.setBlocks(x11, y11 - 1, z11, x11 + 6, y11, z11 + 5, 0)
        mc.setBlocks(x22, y22 + 10, z22, x22 + 6, y22, z22 + 5, 0)