def setup(): print("resetting the map") minecraft.setBlocks(-128, 0, -128, 128, 64, 128, block.AIR.id) minecraft.setBlocks(-128, -1, -128, 128, -1, 128, block.SANDSTONE.id) minecraft.player.setPos(15, 20, 15) minecraft.setting("world_immutable", True)
import time,mcpi.minecraft as mc game = mc.Minecraft.create() mc.setBlocks(2,2,2,2,2,2)
def clear_board(minecraft): minecraft.setBlocks(-MAX_XZ, 0, -MAX_XZ, MAX_XZ, MAX_Y, MAX_XZ, 0) minecraft.setBlocks(-MAX_XZ, 0, -MAX_XZ, MAX_XZ, -MAX_Y, MAX_XZ, BASE_BLOCK_ID)
def clear_board(minecraft): minecraft.setBlocks(-MAX_XZ, 0, -MAX_XZ, MAX_XZ, MAX_Y, MAX_XZ, 0) minecraft.setBlocks(-MAX_XZ, 0, -MAX_XZ, MAX_XZ, -MAX_Y, MAX_XZ, BASE_BLOCK_ID)
#!/usr/bin/python import mcpi.minecraft import mcpi.block import RPi.GPIO import time minecraft = mcpi.minecraft.Minecraft.create() button = 8 RPi.GPIO.setmode(RPi.GPIO.BCM) RPi.GPIO.setup(button, RPi.GPIO.IN, RPi.GPIO.PUD_DOWN) try: while True: if RPi.GPIO.input(button) == True: position = minecraft.player.getTilePos() minecraft.setBlocks(position.x - 1, position.y, position.z - 1, position.x + 1, position.y, position.z + 1, mcpi.block.SAND) minecraft.player.setPos(position.x, position.y + 1, position.z) time.sleep(0.2) except KeyboardInterrupt: RPi.GPIO.cleanup()
def changeBlocks(material): minecraft.setBlocks(-8, 4, 5, -7, 4, 4, material)