Initial commit

This commit is contained in:
BarsTigerMeowcat
2020-01-26 12:49:01 +02:00
commit 8bed7171c2
125 changed files with 3212 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Project exclude paths
/venv/

6
.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM">
<file url="file://$PROJECT_DIR$/files/pickleFile" charset="UTF-8" />
</component>
</project>

7
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonmc.iml" filepath="$PROJECT_DIR$/.idea/pythonmc.iml" />
</modules>
</component>
</project>

14
.idea/pythonmc.iml generated Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/BookCraigRichardson/variabl" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
position = mc.player.getTilePos()
x = position.x
y = position.y
z = position.z
highestBlockY = mc.getHeight(x, z)
aboveGround = y >= highestBlockY
print("highestBlock: " + str(highestBlockY) + " y:" + str(y))
mc.postToChat("Igrok nad zemloy? " + str(aboveGround))

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
x = 95
y = 80
z = 340
eda = 103
blockType = mc.getBlock(x, y, z)
noMelon = not blockType == eda
mc.postToChat("Nuzna eda: " + str(noMelon))

View File

@@ -0,0 +1,16 @@
from mcpi.minecraft import Minecraft
import math
mc = Minecraft.create()
homeX = 95
homeZ = 341
dalekoOtDoma = 200
position = mc.player.getTilePos()
x = position.x
z = position.z
distance = math.sqrt((homeX - x) ** 2 + (homeZ - z) ** 2)
print(distance)
mc.postToChat("Player's home is near: " + str(distance <= dalekoOtDoma))

View File

@@ -0,0 +1,6 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
immutableIs = False
mc.setting("world_immutable", immutableIs)

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blockType = mc.getBlock(x, y - 1, z)
mc.postToChat("Na dereve? " + str(blockType == 17 or blockType == 18))

View File

@@ -0,0 +1,26 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
x1d1 = 92
y1d1 = 63
z1d1 = 341
x2d1 = 98
y2d1 = 87
z2d1 = 343
x1d2 = 95
y1d2 = 93
z1d2 = 324
x2d2 = 99
y2d2 = 96
z2d2 = 330
pos = mc.player.getTilePos()
time.sleep(1)
inside1 = (x1d1 <= pos.x <= x2d1) and (y1d1 <= pos.y <= y2d1) and (z1d1 <= pos.z <= z2d1)
inside2 = (x1d2 <= pos.x <= x2d2) and (y1d2 <= pos.y <= y2d2) and (z1d2 <= pos.z <= z2d2)
mc.postToChat("vnutri doma ? " + str(inside1 or inside2))

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blockType = mc.getBlock(x, y - 1, z)
notAir = str(blockType != 0)
mc.postToChat("Ne v vozduhe? " + notAir)

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blockType = mc.getBlock(x, y, z)
mc.postToChat("Vokrug voda? " + str(blockType == 9))

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blockType = mc.getBlock(x, y, z)
blockType2 = mc.getBlock(x, y + 1, z)
mc.postToChat("Pod vodoy? " + str(blockType == 9 and blockType2 == 9))

View File

@@ -0,0 +1,33 @@
class Bird(object):
def __init__(self, name, wingspan):
self.name = name
self.wingspan = wingspan
def birdcall(self):
print("чик-чирик")
def fly(self):
print("хлоп-хлоп")
class Penguin(Bird):
def swim(self):
print("умеет плавать")
def birdcall(self):
print("квак")
def fly(self):
print("пингвины не летают :(")
class Parrot(Bird):
def __init__(self, name, wingspan, color):
self.name = name
self.wingspan = wingspan
self.color = color
gardenBird = Bird("Geoffrey", 12)
gardenBird.birdcall()
gardenBird.fly()
sarahThePenguin = Penguin("Sarah", 10)
sarahThePenguin.swim()
sarahThePenguin.fly()
sarahThePenguin.birdcall()
freddieTheParrot = Parrot("Freddie", 12, "синий")
print(freddieTheParrot.color)
freddieTheParrot.fly()
freddieTheParrot.birdcall()

View File

@@ -0,0 +1,34 @@
class Cat(object):
owner = "Андрей"
def __init__(self, name, weight):
self.name = name
self.weight = weight
def getWeightInGrams(self):
return self.weight * 1000
def eat(self, food):
self.weight = self.weight + 0.05
print(self.name + " ест " + food)
def eatAndSleep(self, food):
self.eat(food)
print(self.name + " теперь спит...")
myCat = Cat("Барсик", 4.5)
mySecondCat = Cat("Мурка", 3.9)
mySecondCat.owner = "Бабу:)"
print("имя кота: " + str(myCat.name))
print("имя кошки: " + str(mySecondCat.name))
print("вес кота до еды: " + str(myCat.weight))
print("вес кота до еды в граммах: " + str(myCat.getWeightInGrams()))
mySecondCat.eat("торт")
myCat.eatAndSleep("рыбу")
print("вес кота после еды: " + str(myCat.weight))
print("вес котапосле еды в граммах: " + str(myCat.getWeightInGrams()))
print(myCat.owner)
print(mySecondCat.owner)

View File

@@ -0,0 +1,58 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
buildingName = input("Как назовем замок? (только англ. буквами) ")
kolVo = int(input("Сколько раз появиться замок? "))
class NamedBuilding(object):
def __init__(self, x, y, z, width, height, depth, name):
self.x = x
self.y = y
self.z = z
self.width = width
self.height = height
self.depth = depth
self.name = name
def build(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 4)
mc.setBlocks(self.x + 1, self.y + 1, self.z + 1, self.x + self.width - 1, self.y + self.height - 1, self.z + self.depth - 1, 0)
def buildDoor(self):
mc.setBlocks(self.x + (self.width / 2), self.y + 1, self.z, self.x + (self.width / 2), self.y + 2, self.z, 0)
def buildWindows(self):
mc.setBlock(self.x + (self.width / 4 * 3), self.y + 2, self.z, 0)
mc.setBlock(self.x + (self.width / 4), self.y + 2, self.z, 0)
def clear(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 0)
def getInfo(self):
return self.name + " imeet koordinati " + str(self.x) + ", " + str(self.y) + ", " + str(self.z)
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
ghostBuilding = NamedBuilding(x, y, z, 10, 16, 16, buildingName)
def buildAndClear():
ghostBuilding.build()
ghostBuilding.buildDoor()
ghostBuilding.buildWindows()
mc.postToChat(ghostBuilding.getInfo())
time.sleep(15)
ghostBuilding.clear()
ghostBuilding.x = random.randint(ghostBuilding.x - 50, ghostBuilding.x + 50)
ghostBuilding.z = random.randint(ghostBuilding.z - 50, ghostBuilding.z + 50)
ghostBuilding.y = mc.getHeight(ghostBuilding.x, ghostBuilding.z)
for i in range(kolVo):
buildAndClear()

View File

@@ -0,0 +1,104 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
kolVo = int(input("Сколько раз появиться гостиница? "))
class Building(object):
def __init__(self, x, y, z, width, height, depth):
self.x = x
self.y = y
self.z = z
self.width = width
self.height = height
self.depth = depth
def build(self):
mc.setBlocks(self.x, self.y, self.z,
self.x + self.width, self.y + self.height, self.z + self.depth, 4)
mc.setBlocks(self.x + 1, self.y + 1, self.z + 1,
self.x + self.width - 1, self.y + self.height - 1, self.z + self.depth - 1, 0)
self.buildWindows()
self.buildDoor()
def clear(self):
mc.setBlocks(self.x, self.y, self.z,
self.x + self.width, self.y + self.height, self.z + self.depth, 0)
def buildWindows(self):
mc.setBlock(self.x + (self.width / 4 * 3), self.y + 2, self.z, 95)
mc.setBlock(self.x + (self.width / 4), self.y + 2, self.z, 95)
def buildDoor(self):
mc.setBlocks(self.x + (self.width / 2), self.y + 1, self.z, self.x + (self.width / 2), self.y + 2, self.z, 194)
class FancyBuilding(Building):
def upgrade(self):
mc.setBlocks(self.x + 1, self.y, self.z + 1,
self.x + self.width - 1, self.y, self.z + self.depth - 1,
35, 6)
mc.setBlocks(self.x - 1, self.y, self.z - 1,
self.x - 1, self.y, self.z + self.depth + 1,
37)
mc.setBlocks(self.x - 1, self.y, self.z - 1,
self.x + self.width + 1, self.y, self.z - 1,
37)
mc.setBlocks(self.x + self.width + 1, self.y, self.z - 1,
self.x + self.width + 1, self.y, self.z + self.depth + 1,
37)
mc.setBlocks(self.x - 1, self.y, self.z + self.depth + 1,
self.x + self.width + 1, self.y, self.z + self.depth + 1,
37)
def clear(self):
mc.setBlocks(self.x, self.y, self.z,self.x + self.width, self.y + self.height, self.z + self.depth, 0)
mc.setBlocks(self.x - 1, self.y, self.z - 1,
self.x - 1, self.y, self.z + self.depth + 1,
0)
mc.setBlocks(self.x - 1, self.y, self.z - 1,
self.x + self.width + 1, self.y, self.z - 1,
0)
mc.setBlocks(self.x + self.width + 1, self.y, self.z - 1,
self.x + self.width + 1, self.y, self.z + self.depth + 1,
0)
mc.setBlocks(self.x - 1, self.y, self.z + self.depth + 1,
self.x + self.width + 1, self.y, self.z + self.depth + 1,
0)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
ghostHotel = FancyBuilding(x, y, z, 10, 6, 8)
def buildAndClear():
ghostHotel.build()
ghostHotel.buildDoor()
ghostHotel.buildWindows()
ghostHotel.upgrade()
time.sleep(15)
ghostHotel.clear()
ghostHotel.x = random.randint(ghostHotel.x - 50, ghostHotel.x + 50)
ghostHotel.z = random.randint(ghostHotel.z - 50, ghostHotel.z + 50)
ghostHotel.y = mc.getHeight(ghostHotel.x, ghostHotel.z)
for i in range(kolVo):
buildAndClear()

View File

@@ -0,0 +1,51 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
kolVo = int(input("Сколько раз появиться дом? "))
class Building(object):
def __init__(self, x, y, z, width, height, depth):
self.x = x
self.y = y
self.z = z
self.width = width
self.height = height
self.depth = depth
def build(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 4)
mc.setBlocks(self.x + 1, self.y + 1, self.z + 1, self.x + self.width - 1, self.y + self.height - 1, self.z + self.depth - 1, 0)
def buildDoor(self):
mc.setBlocks(self.x + (self.width / 2), self.y + 1, self.z, self.x + (self.width / 2), self.y + 2, self.z, 0)
def buildWindows(self):
mc.setBlock(self.x + (self.width / 4 * 3), self.y + 2, self.z, 0)
mc.setBlock(self.x + (self.width / 4), self.y + 2, self.z, 0)
def clear(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 0)
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
ghostHouse = Building(x, y, z, 10, 6, 8)
def buildAndClear():
ghostHouse.build()
ghostHouse.buildDoor()
ghostHouse.buildWindows()
time.sleep(15)
ghostHouse.clear()
ghostHouse.x = random.randint(ghostHouse.x - 50, ghostHouse.x + 50)
ghostHouse.z = random.randint(ghostHouse.z - 50, ghostHouse.z + 50)
ghostHouse.y = mc.getHeight(ghostHouse.x, ghostHouse.z)
for i in range(kolVo):
buildAndClear()

View File

@@ -0,0 +1,78 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
kolVo = int(input("Сколько раз появиться дерево? "))
class Building(object):
def __init__(self, x, y, z, width, height, depth):
self.x = x
self.y = y
self.z = z
self.width = width
self.height = height
self.depth = depth
def build(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 4)
mc.setBlocks(self.x + 1, self.y + 1, self.z + 1, self.x + self.width - 1, self.y + self.height - 1, self.z + self.depth - 1, 0)
def buildDoor(self):
mc.setBlocks(self.x + (self.width / 2), self.y + 1, self.z, self.x + (self.width / 2), self.y + 2, self.z, 0)
def buildWindows(self):
mc.setBlock(self.x + (self.width / 4 * 3), self.y + 2, self.z, 0)
mc.setBlock(self.x + (self.width / 4), self.y + 2, self.z, 0)
def clear(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 0)
class Tree(Building):
def build(self):
wood = 17
leaves = 18
mc.setBlocks(self.x, self.y, self.z, self.x, self.y + 5, self.z, wood)
mc.setBlocks(self.x - 2, self.y + 6, self.z - 2, self.x + 2, self.y + 6, self.z + 2, leaves)
mc.setBlocks(self.x - 1, self.y + 7, self.z - 1, self.x + 1, self.y + 7, self.z + 1, leaves)
def getInfo(self):
return"Derevo imeet koordinati " + str(self.x) + ", " + str(self.y) + ", " + str(self.z)
def clear(self):
mc.setBlocks(self.x, self.y, self.z, self.x, self.y + 5, self.z, 0)
mc.setBlocks(self.x - 2, self.y + 6, self.z - 2, self.x + 2, self.y + 6, self.z + 2, 0)
mc.setBlocks(self.x - 1, self.y + 7, self.z - 1, self.x + 1, self.y + 7, self.z + 1, 0)
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
ghostTree = Tree(x, y, z, 10, 6, 8)
def buildAndClear():
ghostTree.build()
mc.postToChat(ghostTree.getInfo())
print(ghostTree.getInfo())
time.sleep(5)
ghostTree.clear()
ghostTree.x = random.randint(ghostTree.x - 20, ghostTree.x + 20)
ghostTree.z = random.randint(ghostTree.z - 20, ghostTree.z + 20)
ghostTree.y = mc.getHeight(ghostTree.x, ghostTree.z)
for i in range(kolVo):
buildAndClear()

View File

@@ -0,0 +1,81 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
kolVo = int(input("Сколько раз появиться поселок? "))
class Building(object):
def __init__(self, x, y, z, width, height, depth):
self.x = x
self.y = y
self.z = z
self.width = width
self.height = height
self.depth = depth
def build(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 4)
mc.setBlocks(self.x + 1, self.y + 1, self.z + 1, self.x + self.width - 1, self.y + self.height - 1, self.z + self.depth - 1, 0)
def buildDoor(self):
mc.setBlocks(self.x + (self.width / 2), self.y + 1, self.z, self.x + (self.width / 2), self.y + 2, self.z, 0)
def buildWindows(self):
mc.setBlock(self.x + (self.width / 4 * 3), self.y + 2, self.z, 0)
mc.setBlock(self.x + (self.width / 4), self.y + 2, self.z, 0)
def clear(self):
mc.setBlocks(self.x, self.y, self.z, self.x + self.width, self.y + self.height, self.z + self.depth, 0)
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
ghostHouse = Building(x, y, z, 10, 6, 8)
shop = Building(x + 12, y, z, 8, 12, 10)
scaryHouse = Building(x + 24, y, z, 5, 30, 5)
castle = Building(x + 36, y, z, 10, 16, 16)
def buildAndClear():
ghostHouse.build()
ghostHouse.buildDoor()
ghostHouse.buildWindows()
shop.build()
shop.buildDoor()
shop.buildWindows()
scaryHouse.build()
scaryHouse.buildDoor()
scaryHouse.buildWindows()
castle.build()
castle.buildDoor()
castle.buildWindows()
time.sleep(15)
ghostHouse.clear()
shop.clear()
scaryHouse.clear()
castle.clear()
ghostHouse.x = random.randint(ghostHouse.x - 50, ghostHouse.x + 50)
ghostHouse.z = random.randint(ghostHouse.z - 50, ghostHouse.z + 50)
ghostHouse.y = mc.getHeight(ghostHouse.x, ghostHouse.z)
shop.x = random.randint(shop.x - 50, shop.x + 50)
shop.z = random.randint(shop.z - 50, shop.z + 50)
shop.y = mc.getHeight(shop.x, shop.z)
scaryHouse.x = random.randint(scaryHouse.x - 50, scaryHouse.x + 50)
scaryHouse.z = random.randint(scaryHouse.z - 50, scaryHouse.z + 50)
scaryHouse.y = mc.getHeight(scaryHouse.x, scaryHouse.z)
castle.x = random.randint(castle.x - 50, castle.x + 50)
castle.z = random.randint(castle.z - 50, castle.z + 50)
castle.y = mc.getHeight(castle.x, castle.z)
for i in range(kolVo):
buildAndClear()

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
class Location(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
bedroom = Location(96, 80, 341)
mc.player.setTilePos(bedroom.x, bedroom.y, bedroom.z)

View File

@@ -0,0 +1,26 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import shelve
def buildStructure(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in reversed(row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
x += 1
z = zStart
y += 1
x = xStart
name = input("Введите название конструкции, которую хотите построить ")
superBuildsFile = shelve.open("superBuildsFile.db")
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
buildStructure(x, y, z, superBuildsFile[name])

View File

@@ -0,0 +1,26 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
def buildStructure(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in reversed(row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
x += 1
z = zStart
y += 1
x = xStart
name = input("Введите название файла, который хотите открыть ") + ".txt"
file = open(name, "rb")
structure = pickle.load(file)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
buildStructure(x, y, z, structure)

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
toDoFile = open("toDoFile.txt", "w", encoding="utf-8")
mnogoZapominaushihKotikov = ""
odinKotik = input("Введите описание дела(vot tak), котики его запомнят: ")
while odinKotik != "zxc":
mnogoZapominaushihKotikov = mnogoZapominaushihKotikov + odinKotik + "\n"
odinKotik = input("Введите описание дела(vot tak)(или zxc для выхода)(после поставьте пробел и нажмите ENTER), котики его запомнят: ")
toDoFile.write(mnogoZapominaushihKotikov)
toDoFile.close(),

View File

@@ -0,0 +1,6 @@
from flask import Flask
app = Flask(__name__)
@app.route("/")
def showName():
return "Андрей Мешко"
app.run()

View File

@@ -0,0 +1,8 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
zapominausieKotiki = open("toDoFile.txt", "r")
for zapominausiyKotik in zapominausieKotiki:
mc.postToChat(zapominausiyKotik)
print(zapominausiyKotik)

View File

@@ -0,0 +1,12 @@
from flask import Flask
app = Flask(__name__)
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x, y, z = str(pos.x), str(pos.y), str(pos.z)
@app.route("/")
def showPosition():
return "Ваши координаты на момент запуска программы: " + "х-" + x + ", y-" + y + ", z-" + z
app.run()

View File

@@ -0,0 +1,50 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import shelve
def sortPair(val1, val2):
if val1 > val2:
return val2, val1
else:
return val1, val2
def copyStructure(x1, y1, z1, x2, y2, z2):
x1, x2 = sortPair(x1, x2)
y1, y2 = sortPair(y1, y2)
z1, z2 = sortPair(z1, z2)
width = x2 - x1
height = y2 - y1
length = z2 - z1
structure = []
print("Подождите, пока мы смотрим видео про котиков и заставляем себя начать копировать блоки воздуха, которые вы случайно добавили в пространство копирования, в список")
print("ЧТО? Так быстро закончилось видео? Ну ладно, начинаем. А вы пока покормите своих оцелотов")
for row in range(height):
structure.append([])
for column in range(width):
structure[row].append([])
for depth in range(length):
block = mc.getBlock(x1 + column, y1 + row, z1 + depth)
structure[row][column].append(block)
return structure
input("Подойдите к одному углу констукции и нажмите ")
pos = mc.player.getTilePos()
x1, y1, z1 = pos.x, pos.y, pos.z
input("Подойдите к противоположному углу и нажмите ")
pos = mc.player.getTilePos()
x2, y2, z2 = pos.x, pos.y, pos.z
structure = copyStructure(x1, y1, z1, x2, y2, z2)
structureName = input("Как назовем конструкцию? ")
superBuildsFile = shelve.open("superBuildsFile.db")
superBuildsFile[structureName] = structure
superBuildsFile.close()

View File

@@ -0,0 +1,51 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
def sortPair(val1, val2):
if val1 > val2:
return val2, val1
else:
return val1, val2
def copyStructure(x1, y1, z1, x2, y2, z2):
x1, x2 = sortPair(x1, x2)
y1, y2 = sortPair(y1, y2)
z1, z2 = sortPair(z1, z2)
width = x2 - x1
height = y2 - y1
length = z2 - z1
structure = []
print("Подождите, пока мы смотрим видео про котиков и заставляем себя начать копировать блоки воздуха, которые вы случайно добавили в пространство копирования, в список")
print("ЧТО? Так быстро закончилось видео? Ну ладно, начинаем. А вы пока покормите своих оцелотов")
for row in range(height):
structure.append([])
for column in range(width):
structure[row].append([])
for depth in range(length):
block = mc.getBlock(x1 + column, y1 + row, z1 + depth)
structure[row][column].append(block)
return structure
input("Подойдите к одному углу констукции и нажмите ")
pos = mc.player.getTilePos()
x1, y1, z1 = pos.x, pos.y, pos.z
input("Подойдите к противоположному углу и нажмите ")
pos = mc.player.getTilePos()
x2, y2, z2 = pos.x, pos.y, pos.z
structure = copyStructure(x1, y1, z1, x2, y2, z2)
nameOfFile = input("Как назовем файл? ") + ".txt"
nameOfFile = open(nameOfFile, "xb")
pickle.dump(structure, nameOfFile)
# pickleFile = open("pickleFile.txt", "wb")
# pickle.dump(structure, pickleFile)

View File

@@ -0,0 +1,2 @@
koti
koti

Binary file not shown.

View File

@@ -0,0 +1,28 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
def brokenBlock():
brokenBlocks = [48, 67, 4, 4, 4, 4]
block = random.choice(brokenBlocks)
return block
pos = mc.player.getTilePos()
x, y, z = pos.x, pos. y, pos.z
brokenWall = []
height, width = 5, 10
for row in range(height):
brokenWall.append([])
for column in range(width):
block = brokenBlock()
brokenWall[row].append(block)
for row in brokenWall:
for block in row:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = pos.x

View File

@@ -0,0 +1,62 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def sortPair(val1, val2):
if val1 > val2:
return val2, val1
else:
return val1, val2
def copyStructure(x1, y1, z1, x2, y2, z2):
x1, x2 = sortPair(x1, x2)
y1, y2 = sortPair(y1, y2)
z1, z2 = sortPair(z1, z2)
width = x2 - x1
height = y2 - y1
length = z2 - z1
structure = []
print("Подождите, пока мы смотрим видео про котиков и заставляем себя начать копировать блоки воздуха, которые вы случайно добавили в пространство копирования, в список")
print("ЧТО? Так быстро закончилось видео? Ну ладно, начинаем. А вы пока покормите своих оцелотов")
for row in range(height):
structure.append([])
for column in range(width):
structure[row].append([])
for depth in range(length):
block = mc.getBlock(x1 + column, y1 + row, z1 + depth)
structure[row][column].append(block)
return structure
def buildStructure(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in reversed(row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
x += 1
z = zStart
y += 1
x = xStart
input("Подойдите к одному углу констукции и нажмите ")
pos = mc.player.getTilePos()
x1, y1, z1 = pos.x, pos.y, pos.z
input("Подойдите к противоположному углу и нажмите ")
pos = mc.player.getTilePos()
x2, y2, z2 = pos.x, pos.y, pos.z
structure = copyStructure(x1, y1, z1, x2, y2, z2)
input("Мы закончили страдать фигней, и делать что-то вместо копирования(даже как-то успели все скопировать), поэтому подойдите к месту, куда хотите поставить постройку и нажмите тут ")
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
buildStructure(x, y, z, structure)
print("СМОТРИТЕ" + str(structure) + " - это тот список в который мы засунули блоки")

View File

@@ -0,0 +1,24 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
cube = [[[57, 57, 57, 57], [57, 0, 0, 57], [57, 0, 0, 57], [57, 57, 57, 57]],
[[57, 0, 0, 57], [0, 0, 0, 0], [0, 0, 0, 0], [57, 0, 0, 57]],
[[57, 0, 0, 57], [0, 0, 0, 0], [0, 0, 0, 0], [57, 0, 0, 57]],
[[57, 57, 57, 57], [57, 0, 0, 57], [57, 0, 0, 57], [57, 57, 57, 57]]]
startingX, startingY = x, y
for depth in cube:
for heigth in reversed(depth):
for block in heigth:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = startingX
z += 1
y = startingY

View File

@@ -0,0 +1,24 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getPos()
x, y, z = pos.x, pos.y, pos.z
podnozniyBlock = mc.getBlock(x, y, z)
blockPodNogami = []
for item in range(80):
blockPodNogami.append(podnozniyBlock)
y = y - 1
podnozniyBlock = mc.getBlock(x, y, z)
if 56 in blockPodNogami:
mc.postToChat("Almazi na pribliz. glubine " + str(blockPodNogami.index(56)))
break
else:
mc.postToChat("Rudi net :(")
print(blockPodNogami)

View File

@@ -0,0 +1,14 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
block = int(input("Введите ID блока, в который превратятся ударённые вами блоки(103-арбуз, 57-алмаз и т.д.) "))
time.sleep(10)
hits = mc.events.pollBlockHits()
for hit in hits:
x, y, z = hit.pos.x, hit.pos.y, hit.pos.z
mc.setBlock(x, y, z, block)

View File

@@ -0,0 +1,30 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def setPillar(x, y, z, height):
stairBlock = 156
block = 155
mc.setBlocks(x - 1, y + height, z - 1, x + 1, y + height, z + 1, block, 1)
mc.setBlock(x - 1, y + height - 1, z, stairBlock, 12)
mc.setBlock(x + 1, y + height - 1, z, stairBlock, 13)
mc.setBlock(x, y + height - 1, z + 1, stairBlock, 15)
mc.setBlock(x, y + height - 1, z - 1, stairBlock, 14)
mc.setBlocks(x - 1, y, z - 1, x + 1, y, z + 1, block, 1)
mc.setBlock(x - 1, y + 1, z, stairBlock, 0)
mc.setBlock(x + 1, y + 1, z, stairBlock, 1)
mc.setBlock(x, y + 1, z + 1, stairBlock, 3)
mc.setBlock(x, y + 1, z - 1, stairBlock, 2)
mc.setBlocks(x, y, z, x, y + height, z, block, 2)
pos = mc.player.getTilePos()
x, y, z = pos.x + 2, pos.y, pos.z
skolkoKolonn = int(input("Сколько колонн? "))
rasstoyanie = int(input("Сколько расстояние между колоннами? "))
visota = int(input("Какой высоты колонны? "))
for item in range(0, skolkoKolonn):
setPillar(x + item * rasstoyanie, y, z, visota)

View File

@@ -0,0 +1,25 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
blocks = [[35, 35, 22, 22, 22, 22, 35, 35],
[35, 22, 35, 35, 35, 35, 22, 35],
[22, 35, 22, 35, 35, 22, 35, 22],
[22, 35, 35, 35, 35, 35, 35, 22],
[22, 35, 22, 35, 35, 22, 35, 22],
[22, 35, 35, 22, 22, 35, 35, 22],
[22, 35, 35, 35, 35, 35, 35, 22],
[35, 22, 35, 35, 35, 35, 22, 35],
[35, 35, 22, 22, 22, 22, 35, 35]]
for row in reversed(blocks):
for block in row:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = pos.x

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
block = 24
height = int(input("Введите высоту пирамиды "))
levels = reversed(range(height))
pos = mc.player.getTilePos()
x, y, z = pos.x + height, pos.y, pos.z
for level in levels:
mc.setBlocks(x - level, y, z - level, x + level, y, z + level, block)
y += 1

View File

@@ -0,0 +1,19 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
twoDimensionalRainbowList = [[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4],
[5, 5, 5]]
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
startingX = x
for row in twoDimensionalRainbowList:
for color in row:
mc.setBlock(x, y, z, 35, color)
x += 1
y += 1
x = startingX

View File

@@ -0,0 +1,12 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
oneDimensionalRainbowList = [0, 1, 2, 3, 4, 5]
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
for color in oneDimensionalRainbowList:
mc.setBlock(x, y, z, 35, color)
y += 1

View File

@@ -0,0 +1,20 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
stairBlock = 53
x, y, z = pos.x, pos.y, pos.z
dlina = int(input("Какой высоты будет лестница? "))
for item in range(0, dlina):
mc.setBlock(x + item, y + item, z, stairBlock)
input("Нажмите ENTER, чтобы удалить лестницу ")
for nomerDel in range(0, dlina):
mc.setBlock(x + nomerDel, y + nomerDel, z, 0)

View File

@@ -0,0 +1,25 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
name = ""
scoreboard = {}
while True:
name = input("Джедай ударов по блокам правой кнопкой меча, имя свое введи... (выйти дабы, простое слово стоп введи) ")
if name == "стоп":
break
time.sleep(0.5)
mc.postToChat("Nachinaem! Da prebudet s vami sila!!!")
time.sleep(15)
blockHits = mc.events.pollBlockHits()
blockHitsLength = len(blockHits)
mc.postToChat("Vash chet " + str(blockHitsLength))
scoreboard[name] = blockHitsLength
for name in scoreboard:
print(name + "-" + str(scoreboard[name]))

View File

@@ -0,0 +1,61 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def melon():
return 103
def water():
return 9
def dinamit():
return 46
def fakel():
return 50
def dragonEgg():
return 122
def maak():
return 138
def morskoyfonar():
return 169
def ogon():
return 51
def almazniyBlock():
return 57
def voproshalka():
polzovatelZabilIDBloka = input("Введите название блока: ")
if polzovatelZabilIDBloka == "арбуз":
return melon()
elif polzovatelZabilIDBloka == "вода":
return water()
elif polzovatelZabilIDBloka == "динамит":
return dinamit()
elif polzovatelZabilIDBloka == "факел":
return fakel()
elif polzovatelZabilIDBloka == "драконье яйцо":
return dragonEgg()
elif polzovatelZabilIDBloka == "маяк":
return maak()
elif polzovatelZabilIDBloka == "морской фонарь":
return morskoyfonar()
elif polzovatelZabilIDBloka == "огонь":
return ogon()
elif polzovatelZabilIDBloka == "алмазный блок":
return almazniyBlock()
def stavilka():
block = voproshalka()
mc.postToChat(block)
pos = mc.player.getTilePos()
mc.setBlock(pos.x, pos. y, pos.z, block)
stavilka()

View File

@@ -0,0 +1,39 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def growTree(x, y, z):
blockTypeDerevo = 17
blockTypeLista = 161
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
y = y + 1
mc.setBlock(x, y, z, blockTypeDerevo)
dlinaNiza = 2
shirinaNiza = 2
visotaNiza = 1
mc.setBlocks(x - 2, y, z - 2, x + dlinaNiza, y + visotaNiza, z + shirinaNiza, blockTypeLista)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
growTree(x + 1, y, z)
growTree(x + 6, y, z)
growTree(x + 12, y, z)
growTree(x + 18, y, z)
growTree(x + 24, y, z)
growTree(x + 30, y, z)
growTree(x + 36, y, z)
growTree(x + 42, y, z)

View File

@@ -0,0 +1,23 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
def makeMelon(pos, x, y, z):
pos = mc.player.getPos()
x = pos.x
y = pos.y - 1
z = pos.z
mc.setBlock(x, y, z, 103)
time.sleep(5)
pos = mc.player.getPos()
x = pos.x
y = pos.y - 1
z = pos.z
makeMelon(pos, x, y, z)
makeMelon(pos, x, y, z)
makeMelon(pos, x, y, z)
makeMelon(pos, x, y, z)
makeMelon(pos, x, y, z)
makeMelon(pos, x, y, z)

View File

@@ -0,0 +1,80 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
block = 0
sleep = 0
answerBlock = int(input("Какой блок будет ходить? 1-светильник Джека, 2-алмазный блок, 3-верстак, 4-динамит, 5-замшелый булыжник, "
"6-редстоун блок, 7-саженец дуба, 8-сундук, 9-яйцо дракона, 10-кровать "))
if answerBlock == 1:
block = 91
elif answerBlock == 2:
block = 51
elif answerBlock == 3:
block = 58
elif answerBlock == 4:
block = 46
elif answerBlock == 5:
block = 48
elif answerBlock == 6:
block = 152
elif answerBlock == 7:
block = 6
elif answerBlock == 8:
block = 54
elif answerBlock == 9:
block = 122
elif answerBlock == 10:
block = 26
prType = int(input("Как будет перемещаться блок? 1-ровно и красиво(но есть ловушки, которые он не пройдет) 2-по диагонали, но проходит все ловушки "))
answerSpeed = int(input("Как будет перемещаться блок? 1-медленно, 2-быстро, 3-очень быстро "))
if answerSpeed == 1:
sleep = 1
elif answerSpeed == 2:
sleep = 0.5
elif answerSpeed == 3:
sleep = 0.1
def calculateMove(programType):
global x
global y
global z
currentHeight = mc.getHeight(x, z) - 1
forwardHeight = mc.getHeight(x + 1, z)
rightHeight = mc.getHeight(x, z + 1)
backwardHeight = mc.getHeight(x - 1, z)
leftHeight = mc.getHeight(x, z - 1)
if forwardHeight - currentHeight < 3:
x += 1
if programType == 2:
z += 1
elif rightHeight - currentHeight < 3:
z += 1
if programType == 2:
x += 1
elif leftHeight - currentHeight < 3:
z -= 1
elif backwardHeight - currentHeight < 3:
x -= 1
y = mc.getHeight(x, z)
pos = mc.player.getTilePos()
x = pos.x
z = pos.z
y = mc.getHeight(x, z)
while True:
calculateMove(prType)
mc.setBlock(x, y, z, block)
time.sleep(sleep)
mc.setBlock(x, y, z, 0)

View File

@@ -0,0 +1,43 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
block = 35
def getWoolState(color):
if color == "розовый":
blockState = 6
elif color == "бирюзовый":
blockState = 9
elif color == "голубой":
blockState = 3
elif color == "желтый":
blockState = 4
elif color == "зеленый":
blockState = 13
elif color == "коричневый":
blockState = 12
elif color == "красный":
blockState = 14
elif color == "оранжевый":
blockState = 1
elif color == "зеленый":
blockState = 5
elif color == "светло-серый":
blockState = 8
elif color == "серый":
blockState = 7
elif color == "синий":
blockState = 11
elif color == "черный":
blockState = 15
elif color == "белый":
blockState = 0
return blockState
colorString = input("Введите цвет блока: ")
state = getWoolState(colorString)
pos = mc.player.getTilePos()
mc.postToChat("Tip i cvet blocka: " + str(block) + "," + str(state))
mc.setBlock(pos.x, pos.y, pos.z, block, state)

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
answer = input("Точно создать кратер? Он может уничтожить находящиеся рядом постройки! Д/Н")
if answer == "Д" or answer == "д" :
pos = mc.player.getPos()
mc.setBlocks(pos.x + 1, pos.y + 1, pos.z + 1, pos.x - 1, pos.y - 1, pos.z - 1, 0)
mc.postToChat("Babah!!!")

View File

@@ -0,0 +1,29 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
x = 91
y = 77
z = 341
gift = mc.getBlock(x, y, z)
if gift == 57:
mc.postToChat("Bog almazov ochen rad!")
time.sleep(3)
mc.setBlock(x, y, z, 0)
elif gift == 103:
mc.postToChat("Arbuz - toze normalno")
time.sleep(3)
mc.setBlock(x, y, z, 0)
else:
mc.player.setTilePos(100.859, 64, 357.531)
mc.postToChat("Nuzno davat podarki! Postav almazniy blok na arbuz i nazmi (Sm python console)!")
mc.setBlock(x, y, z, 0)
input("Нажми любую клавишу")
if mc.getBlock(101, 64, 357) == 57:
mc.setBlock(101,64 ,357 , 0)
mc.player.setPos(94, 76, 341)
mc.postToChat("Spasibo")

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
answer = input("Защитить мир от изменений? Д/Н")
if answer == "д":
mc.setting("world_immutable", True)
mc.postToChat("Zashita vkl")
else:
mc.setting("world_immutable", False)
mc.postToChat("Zashita vikl")

View File

@@ -0,0 +1,36 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
x = 97
y = 76
z = 342
x1 = 95
y1 = 64
z1 = 344
gift = mc.getBlock(x, y, z)
gift1 = mc.getBlock(x1, y1, z1)
if gift != 0 or gift1 != 0:
mc.setBlock(95, 75, 341, 0)
mc.setBlock(95, 63, 344, 0)
mc.setBlock(95, 63, 343, 0)
mc.setBlock(95, 64, 343, 0)
mc.setBlock(95, 64, 344, 0)
mc.setBlock(x, y, z, 0)
time.sleep(10)
mc.setBlock(95, 75, 341, 4)
mc.setBlock(95, 63, 343, 57)
mc.setBlock(95, 64, 343, 57)
mc.setBlock(95, 63, 344, 57)
mc.setBlock(92, 82, 340, random.randint(1, 200))
else:
mc.setBlocks(97, 77, 340, 95, 77, 341, 10)
mc.setBlocks(98, 66, 344, 89, 66, 346, 10)
time.sleep(2)
mc.setBlocks(97, 77, 340, 95, 77, 341, 0)
mc.setBlocks(98, 66, 344, 89, 66, 346, 0)

View File

@@ -0,0 +1,46 @@
import time
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def diamondDoor(blockCode):
mc.setBlock(94, 76, 339, blockCode)
mc.setBlock(94, 77, 339, blockCode)
def openDoor():
diamondDoor(0)
def closeDoor():
diamondDoor(57)
shwrX1 = 93
shwrY1 = 76
shwrZ1 = 336
shwrX2 = 95
shwrY2 = 77
shwrZ2 = 337
pos = mc.player.getTilePos()
def shower():
closeDoor()
mc.setBlocks(shwrX1, shwrY1, shwrZ1, shwrX2, shwrY2, shwrZ2, 8)
time.sleep(5)
mc.setBlocks(shwrX1, shwrY1, shwrZ1, shwrX2, shwrY2, shwrZ2, 0)
time.sleep(3)
openDoor()
if shwrX1 <= pos.x <= shwrX2 and shwrY1 <= pos.y <= shwrY2 and shwrZ1 <= pos.z <= shwrZ2:
shower()
else:
mc.setBlocks(shwrX1, shwrY1, shwrZ1, shwrX2, shwrY2, shwrZ2, 0)
mc.postToChat("Smotri console")
input("Пожалуйста, войдите в душ и нажмите любую клавишу тут")
shower()

View File

@@ -0,0 +1,23 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
time.sleep(0)#задержка секунд
#координаты
valid = True
x = int(input("введите X: "))
y = int(input("введите Y: "))
z = int(input("введите Z: "))
if not -12 < x < 318:
valid = False
if not 0 < y < 130:
valid = False
if not 1 < z < 545:
valid = False
if valid:
mc.player.setTilePos(x, y, z)
mc.postToChat("pratki nachalis!!!")
else:
mc.postToChat("Igraem v pratki chestno! Ne teleportiruemsa daleko!")

View File

@@ -0,0 +1,56 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blocks = [20, 20, 20, 20, 20, 20, 20, 20, 20, 20]
barBlock = 22
count = 0
while count <= len(blocks):
mc.setBlock(x, y, z, blocks[0])
mc.setBlock(x, y + 1, z, blocks[1])
mc.setBlock(x, y + 2, z, blocks[2])
mc.setBlock(x, y + 3, z, blocks[3])
mc.setBlock(x, y + 4, z, blocks[4])
mc.setBlock(x, y + 5, z, blocks[5])
mc.setBlock(x, y + 6, z, blocks[6])
mc.setBlock(x, y + 7, z, blocks[7])
mc.setBlock(x, y + 8, z, blocks[8])
mc.setBlock(x, y + 9, z, blocks[9])
count += 1
del blocks[9]
blocks.insert(0, 22)
time.sleep(1)
mc.setBlock(x, y, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 1, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 2, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 3, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 4, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 5, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 6, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 7, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 8, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 9, z, 0)
time.sleep(0.1)
mc.setBlock(x, y + 10, z, 0)
time.sleep(0.1)

View File

@@ -0,0 +1,21 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
heights = [100, 0]
count = 0
while count < 10:
pos = mc.player.getTilePos()
if pos.y < heights[0]:
heights[0] = pos.y
elif pos.y > heights[1]:
heights[1] = pos.y
count += 1
time.sleep(1)
mc.postToChat("Nizshaa pozicia: " + str(heights[0]))
mc.postToChat("Vissaa pozicia: " + str(heights[1]))

View File

@@ -0,0 +1,20 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
blocks = []
while True:
hits = mc.events.pollBlockHits()
if len(hits) > 0:
hit = hits[0]
hitX, hitY, hitZ = hit.pos.x, hit.pos.y, hit.pos.z
block = mc.getBlock(hitX, hitY, hitZ)
blocks.append(block)
if "56" in blocks:
mc.postToChat("Pssss, beri rudu bistree!")
time.sleep(0.2)
break

View File

@@ -0,0 +1,17 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
places = {"основной дом": (95, 76, 341), "пристройка": (94, 75, 352), "сундучная": (70, 64, 361), "библиотека": (81, 69, 352), "дом отдыха": (104, 82, 324), "поляна": (-32, 64, -197), "горный дом": (68, 89, 351), "дом на дереве": (-439, 66, 2212)}
choice = ""
while choice != "стоп":
choice = input("Введите название комнаты вашего дома, или стоп, для выхода ")
if choice in places:
location = places[choice]
x, y, z = location[0], location[1], location[2]
mc.player.setPos(x, y, z)
elif choice != "стоп" and choice not in places:
print("Но такой комнаты, как ни странно, нет в вашем гигантском доме :(")

View File

@@ -0,0 +1,14 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import random
podhoditID = [57, 7, 103, 56, 5, 15, 48, 3, 47, 49, 16, 35]
block = random.choice(podhoditID)
pos = mc.player.getTilePos()
mc.setBlock(pos.x + 1, pos.y, pos.z + 1, block)

View File

@@ -0,0 +1,17 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
while True:
x += random.uniform(-0.2, 0.2)
z += random.uniform(-0.2, 0.2)
y = mc.getHeight(x, z)
mc.player.setPos(x, y, z)
time.sleep(0.1)

View File

@@ -0,0 +1,10 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
time.sleep(15)
blockHits = mc.events.pollBlockHits()
blockHitsLength = len(blockHits)
mc.postToChat("Vash chet " + str(blockHitsLength))

View File

@@ -0,0 +1,25 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
name = ""
scoreboard = {}
while True:
name = input("Джедай ударов по блокам правой кнопкой меча, имя свое введи... (выйти дабы, простое слово стоп введи) ")
if name == "стоп":
break
time.sleep(0.5)
mc.postToChat("Nachinaem! Da prebudet s vami sila!!!")
time.sleep(15)
blockHits = mc.events.pollBlockHits()
blockHitsLength = len(blockHits)
mc.postToChat("Vash chet " + str(blockHitsLength))
scoreboard[name] = blockHitsLength
print(scoreboard)

View File

@@ -0,0 +1,9 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
position = mc.player.getTilePos()
x = position.x
y = position.y
z = position.z
blockType = 10
y = y - 1
mc.setBlock(x, y ,z, blockType)

View File

@@ -0,0 +1,17 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
x = 12
y = 72
z = -317
blockType = 52
mc.setBlock(x, y, z, blockType)
y = y + 1
mc.setBlock(x, y, z, blockType)
y = y + 1
mc.setBlock(x, y, z, blockType)
y = y + 1
mc.setBlock(x, y, z, blockType)

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getPos()
x = pos.x
y = pos.y
z = pos.z
sirina = int(input("Ширина: "))
visota = int(input("Высота: "))
dlina = int(input("Длина: "))
blockType = int(input("Введите блок: "))
air = int(input("Чем заполнять постройку? (примеры ID: 0-воздух, 9-вода и тд"))
mc.setBlocks(x, y, z, x + sirina, y + visota, z + dlina, blockType )
mc.setBlocks(x + 1, y , z + 1, x + sirina - 1, y + visota - 1, z + dlina - 1, air )

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import random
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
x = x + random.randint(-100, 100)
y = y + random.randint(0, 100)
z = z + random.randint(-100, 100)
mc.player.setTilePos(x, y, z)

View File

@@ -0,0 +1,19 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import random
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
x = x + random.randint(-10, 10)
y = y + random.randint(0, 100)
z = z + random.randint(-10, 10)
mc.player.setTilePos(x, y, z)
blockType = random.randint(1, 200)
mc.setBlock(x, y - 1, z, blockType)
mc.postToChat("Tip bloka:" + str(blockType))

View File

@@ -0,0 +1,19 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getPos()
x = pos.x
y = pos.y
z = pos.z
visota = 3
blockType = 1
sideVisota = visota
mc.setBlocks(x + 1, y , z + 1, x + 3, y + sideVisota - 1, z + 3, blockType)
pointVisota = 5
mc.setBlocks(x + 2, y , z + 2, x + 2, y + pointVisota - 1, z + 2, blockType)
baseVisota = 1
mc.setBlocks(x, y , z, x + 4, y + baseVisota - 1, z + 4, blockType)

View File

@@ -0,0 +1,8 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
position = mc.player.getTilePos()
x = position.x
y = position.y
z = position.z
y = y + 30
mc.player.setTilePos(x, y, z)

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
position = mc.player.getTilePos()
x = position.x
y = position.y
z = position.z
try:
blockType = int (input('Введите номер блока: '))
mc.setBlock(x + 5, y, z + 5, blockType)
except:
print("Это не число. Введите число")

View File

@@ -0,0 +1,3 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
mc.postToChat('Hello world of Minecraft!')

View File

@@ -0,0 +1,4 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
mes = input()
mc.postToChat(mes)

View File

@@ -0,0 +1,25 @@
import time
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
time.sleep(5)
mc.postToChat("Go!")
pos1 = mc.player.getTilePos()
x1 = pos1.x
y1 = pos1.y
z1 = pos1.z
time.sleep(10)
pos2 = mc.player.getTilePos()
x2 = pos2.x
y2 = pos2.y
z2 = pos2.z
xDist = x2 - x1
yDist = y2 - y1
zDist = z2 - z1
mc.postToChat("You moved on x: " + str(xDist) + ", y: " + str(yDist) + ", z: " + str(zDist))

View File

@@ -0,0 +1,5 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
user = input('Введите имя на английском: ')
soobsh = input('Введите сообщение: ')
mc.postToChat(user + ': ' + soobsh)

View File

@@ -0,0 +1,9 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
time.sleep(0)#задержка секунд
#координаты
x = int(input("введите X: "))
y = int(input("введите Y: "))
z = int(input("введите Z: "))
mc.player.setTilePos(x, y, z)

View File

@@ -0,0 +1,14 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
time.sleep(20)#задержка секунд
#координаты
x = 57
y = 100
z = 31
mc.player.setTilePos(x, y, z)
time.sleep(20)#задержка секунд
x = 158
y = 1000
z = 154
mc.player.setTilePos(x, y, z)

View File

@@ -0,0 +1,33 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import math
import time
import random
pos = mc.player.getTilePos()
destX = random.randint(pos.x - 127, pos.x + 127)
destZ = random.randint(pos.z - 127, pos.z + 127)
destY = mc.getHeight(destX, destZ)
block = 57
mc.setBlock(destX, destY, destZ, block)
mc.postToChat("Block sozdan... Prikluchenie nachinaetsa!")
while True:
pos = mc.player.getTilePos()
distance = math.sqrt((pos.x - destX) ** 2 + (pos.z - destZ) ** 2)
if distance > 100:
mc.postToChat("Zamerznesh")
elif distance > 50:
mc.postToChat("Holodno")
elif distance > 25:
mc.postToChat("Teplo")
elif distance > 12:
mc.postToChat("Goracho")
elif distance > 6:
mc.postToChat("Obozzessa!")
elif distance == 0:
mc.postToChat("Pozdravlaem!!! Block nayden!")
break

View File

@@ -0,0 +1,11 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
user = input('Введите имя на английском: ')
while True:
soobsh = input('Введите сообщение(vot takimi bukvami)(чтобы закончить чат, введите stop): ')
if soobsh == 'stop':
break
else:
mc.postToChat(user + ': ' + soobsh)

View File

@@ -0,0 +1,22 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
floorX = pos.x - 2
floorY = pos.y - 1
floorZ = pos.z - 2
width = 5
length = 5
block = 41
mc.setBlocks(floorX, floorY, floorZ, floorX + width, floorY, floorZ + length, block)
while floorX <= pos.x <= floorX + width and floorZ <= pos.z <= floorZ + length:
if block == 41:
block = 57
else:
block = 41
mc.setBlocks(floorX, floorY, floorZ, floorX + width, floorY, floorZ + length, block)
pos = mc.player.getTilePos()
time.sleep(0.5)

View File

@@ -0,0 +1,8 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
while True:
pos = mc.player.getTilePos()
mc.setBlock(pos.x, pos.y, pos.z, 46, 1)
time.sleep(0.2)

View File

@@ -0,0 +1,21 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
score = 0
pos = mc.player.getTilePos()
blockAbove = mc.getBlock(pos.x, pos.y + 2, pos.z)
while blockAbove == 8 or blockAbove == 9:
time.sleep(1)
pos = mc.player.getPos()
blockAbove = mc.getBlock(pos.x, pos.y + 2, pos.z)
score = score + 1
mc.postToChat("Tecushiy schet: " + str(score) + ", Ti smozes!")
mc.postToChat("Okonchatelnyy schet: " + str(score) + ", Ti molodes!")
if score > 6:
finalPos = mc.player.getTilePos()
mc.postToChat("Ti dolgo sidel pod vodoy! Vot tebe svetocniy dozd!")
mc.setBlocks(finalPos.x - 5, finalPos.y + 10, finalPos.z - 5, finalPos.x + 5, finalPos.y + 10, finalPos.z + 5, 38)

View File

@@ -0,0 +1,8 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
while True:
pos = mc.player.getTilePos()
mc.setBlock(pos.x, pos.y, pos.z, 38)
time.sleep(0.2)

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
air = 0
water = 9
while True:
pos = mc.player.getTilePos()
blockBelow = mc.getBlock(pos.x, pos.y - 1, pos.z)
if blockBelow != air and blockBelow != water:
mc.setBlock(pos.x, pos.y - 1, pos.z, 41)

View File

@@ -0,0 +1,17 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import random
import time
count = 0
while count < 10:
x = random.randint(-1000, 1000)
y = random.randint(20, 90)
z = random.randint(-1000, 1000)
mc.player.setTilePos(x, y, z)
time.sleep(20)
count += 1
mc.player.setTilePos(68, 87, 333)

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
input("Точно? Вода потом не уйдет, а останется навсегда (если да, то нажми здесь любую клавишу) ")
count = 0
while count < 30:
pos = mc.player.getTilePos()
mc.setBlock(pos.x, pos.y, pos.z, 8)
time.sleep(1)
count += 1

35
levieProekti/factorial.py Normal file
View File

@@ -0,0 +1,35 @@
n = int(input("Введи число, до которого будет факториал "))
def factorial(kolvo):
fakt = 1
for i in range(1, kolvo + 1):
fakt = fakt * i
return fakt
def factTailRec(kolvo, result):
if kolvo == 0:
return result
else:
return factTailRec(kolvo - 1, result * kolvo)
def fact(kolvo):
if kolvo == 1:
return 1
else:
return kolvo * fact(kolvo - 1)
print(factorial(n))
print(factTailRec(n, 1))
print(fact(n))
if factorial(n) == factTailRec(n, 1) and factorial(n) == fact(n):
print("all OK")
schislo = factorial(n)
print( "dlina " + str(len(str(schislo))) + " simvola")

67
levieProekti/fibonacci.py Normal file
View File

@@ -0,0 +1,67 @@
# n = int(input("Введи число, до которого будут идти поколения "))
# n = 5
def fibonacciRecAux(pokolenia, result, perv, vtor):
if pokolenia == 1:
return 0
tret = perv + vtor
# result = perv + vtor
# pokolenia = pokolenia - 1
if pokolenia == 0:
return result
else:
return fibonacciRecAux(pokolenia - 1, result + tret, vtor, tret)
def fibonacci(n):
return fibonacciRecAux(n, 0, 1, 0)
def fibonacciIt(pokolenia):
if pokolenia == 1:
return 0
perv = 0
vtor = 1
result = perv + vtor
for i in range(1, pokolenia - 1):
tret = perv + vtor
result = result + tret
perv = vtor
vtor = tret
return result
# print(fibonacci(n, 0))
# print(fibonacciRec(n, 0, 0, 1, 0))
# res = fibonacci(n, 0)
if fibonacci(5) == 7:
print('ok')
else:
print('wrong for 5')
if fibonacci(6) == 12:
print('ok')
else:
print('wrong for 6')
if fibonacci(1) == 0:
print('ok for 1')
else:
print('wrong for 1')
if fibonacci(2) == 1:
print('ok')
else:
print('wrong for 2')
if fibonacci(3) == 2:
print('ok')
else:
print('wrong for 3')
if fibonacci(7) == 20:
print('ok')
else:
print('wrong for 7')

View File

@@ -0,0 +1,7 @@
n = int(input("Введи число, до которого я найду простые числа: "))
def finder(n):
prostie = []
ost = 0
for i in range(n):
ost = i % range(i)

View File

@@ -0,0 +1,20 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import shelve
blockIDs = shelve.open("idsFile.db")
ans = input("Введи название блока или букву 'д', чтобы добавить блокТайп: ")
if ans != "д":
if ans in blockIDs:
print(blockIDs[ans])
elif ans not in blockIDs:
print("Вы еще не добавили блока с таким названием :(")
elif ans == "д":
nameOfBlock = input("Введите название блока, который хотите добавить: ")
blockNumber = input("Введите номер этого блока: ")
blockIDs[nameOfBlock] = blockNumber
blockIDs.close()

View File

@@ -0,0 +1,7 @@
class BlockNames:
def __init__(self, id, name):
self.id = id
self.name = name
ВОЗДУХ = BlockNames(0, "Воздух")

View File

@@ -0,0 +1,36 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
x2, y2, z2 = pos.x, pos.y, pos.z
mc.setBlocks(x, y, z, x + 4, y + 4, z + 4, 46)
for block in range(5):
mc.setBlock(x + block, y + 4, z, 0)
mc.setBlock(x, y + 4, z + block, 0)
x2, y2, z2 = x + 4, y, z + 4
for block2 in range(5):
mc.setBlock(x2 - block2, y2 + 4, z2, 0)
mc.setBlock(x2, y2 + 4, z2 - block2, 0)
for block3 in range(5):
mc.setBlock(x + block3, y, z, 0)
mc.setBlock(x, y, z + block3, 0)
x2, y2, z2 = x + 4, y, z + 4
for block4 in range(5):
mc.setBlock(x2 - block4, y2, z2, 0)
mc.setBlock(x2, y2, z2 - block4, 0)
mc.postToChat("Viydite iz blocka")
mc.postToChat("Posmotrite v konsol!")
input("Если хотите взорвать бомбу нажмите тут ")
time.sleep(1)
mc.setBlock(x, y + 3, z, 152)

View File

@@ -0,0 +1,45 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import minecraftstuff
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
mcdrawing = minecraftstuff.MinecraftDrawing(mc)
# x2, y2, z2 = pos.x, pos.y, pos.z
#
# mc.setBlocks(x, y, z, x + 4, y + 4, z + 4, 46)
#
# for block in range(5):
# mc.setBlock(x + block, y + 4, z, 0)
# mc.setBlock(x, y + 4, z + block, 0)
#
# x2, y2, z2 = x + 4, y, z + 4
#
# for block2 in range(5):
# mc.setBlock(x2 - block2, y2 + 4, z2, 0)
# mc.setBlock(x2, y2 + 4, z2 - block2, 0)
#
# for block3 in range(5):
# mc.setBlock(x + block3, y, z, 0)
# mc.setBlock(x, y, z + block3, 0)
#
# x2, y2, z2 = x + 4, y, z + 4
#
# for block4 in range(5):
# mc.setBlock(x2 - block4, y2, z2, 0)
# mc.setBlock(x2, y2, z2 - block4, 0)
mcdrawing.drawSphere(pos.x, pos.y + 7, pos.z, 5, 46)
mc.postToChat("Bomba nad vami!")
mc.postToChat("Posmotrite v konsol!")
ans = input("Если хотите взорвать бомбу нажмите тут(осторожно! взрыв гигантский(чтобы обезвредить бомбу, нажмите букву 'о')) ")
if ans !="о":
time.sleep(1)
mc.setBlock(x, y + 3, z, 152)
elif ans == "о":
mcdrawing.drawSphere(pos.x, pos.y + 7, pos.z, 5, 0)
mc.postToChat("Spasibo, bomba obezvrezena!")
print("Spasibo, bomba obezvrezena!")

View File

@@ -0,0 +1,33 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import minecraftstuff
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
mcdrawing = minecraftstuff.MinecraftDrawing(mc)
radius = 0
yplus = 0
moshnost = int(input("введите мощность бомбы 1-сильная, 2-супервынос,город-динамит,царь-бомба: "))
if moshnost == 1:
radius = 5
yplus = 7
elif moshnost == 2:
radius = 15
yplus = 19
mcdrawing.drawSphere(pos.x, pos.y + yplus, pos.z, radius, 46)
mc.postToChat("Bomba nad vami!")
mc.postToChat("Posmotrite v konsol!")
ans = input("Если хотите взорвать бомбу нажмите тут(осторожно! взрыв гигантский(чтобы обезвредить бомбу, нажмите букву 'о')) ")
if ans !="о":
time.sleep(1)
mc.setBlock(x, y + 4, z, 152)
elif ans == "о":
mcdrawing.drawSphere(pos.x, pos.y + yplus, pos.z, radius, 0)
mc.postToChat("Spasibo, bomba obezvrezena!")
print("Spasibo, bomba obezvrezena!")

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z + 1
dopoln = 0
block = int(input("Введите ID блока: "))
estDopoln = int(input("У этого блока есть дополнительный идентификатор? Нет-0, есть-1 "))
if estDopoln != 0:
dopoln = int(input("Тогда введите этот идентификатор: "))
mc.setBlock(x, y, z, block, dopoln)

View File

@@ -0,0 +1,28 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
import time
def build(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in (row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
time.sleep(0.07)
x += 1
z = zStart
y += 1
x = xStart
file = open("home.txt", "rb")
structure = pickle.load(file)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
build(x, y, z, structure)

View File

@@ -0,0 +1,93 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
import time
def build(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in (row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
time.sleep(0.07)
x += 1
z = zStart
y += 1
x = xStart
def buildTest(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in (row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
x += 1
z = zStart
y += 1
x = xStart
def buildDel(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in (row):
for block in column:
mc.setBlock(x, y, z, 0)
z += 1
x += 1
z = zStart
y += 1
x = xStart
file = open("home.txt", "rb")
structure = pickle.load(file)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
ans = 1
while ans != "ок" or ans != "ok":
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
buildTest(x, y, z, structure)
time.sleep(1)
buildDel(x, y, z, structure)
ans = input("Если вы довольны постройкой и местом постройки введите ок. Если нет - нет или no ")
if ans == "нет" or ans == "no":
buildDel(x, y, z, structure)
break
if ans == "ок" or ans == "ok":
buildDel(x, y, z, structure)
break
build(x, y, z, structure)

View File

@@ -0,0 +1,41 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
import time
nameNumber = int(input("Введите номер постройки, которую хотите: 1 - дом чуток хай-тек; 2 - 'коробка' про; 3 - деревенский дом; 4 - дом-куча нуба "))
name = 0
if nameNumber == 1:
name = "home.txt"
elif nameNumber == 2:
name = "probox.txt"
elif nameNumber == 3:
name = "vilage.txt"
elif nameNumber == 4:
name = "noob.txt"
def build(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in (row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
time.sleep(0.07)
x += 1
z = zStart
y += 1
x = xStart
file = open(name, "rb")
structure = pickle.load(file)
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
build(x, y, z, structure)

Some files were not shown because too many files have changed in this diff Show More