def _drop(self, x, y, z, speed): exploded = False while not exploded: self.mc.setBlock(x, y, z, block.TNT.id) sleep(speed) self.mc.setBlock(x, y, z, block.AIR.id) y = y - 1 if self.mc.getBlock(x, y, z) != block.AIR.id: exploded = True self.mc.postToChat("boom") mcdraw = MinecraftDrawing(self.mc) mcdraw.drawSphere(x, y, z, self.blast, block.AIR.id)
def main(): mc = Minecraft.create("192.168.1.10") x, y, z = mc.player.getPos() mc.postToChat(f"drawing! {x} {y} {z}") mc.setBlock(x+2, y, z, 1) for i in range(100): mc.setBlock(SPAWN[0], SPAWN[1]+i, SPAWN[2], 1) mcdraw = MinecraftDrawing(mc) # draw a diagonal line mcdraw.drawLine(SPAWN[0], SPAWN[1], SPAWN[2], SPAWN[0] - 10, SPAWN[1] + 10, SPAWN[2]+10, block.STONE.id) mcdraw.drawSphere(SPAWN[0]+5, SPAWN[1]+80, SPAWN[2]+20, 20, block.GOLD_BLOCK.id)
mc.player.setPos(-25, 0, -25) #clear area mc.setBlocks(-25, 0, -25, 25, 25, 25, block.AIR.id) #create drawing object mcDrawing = MinecraftDrawing(mc) #line mcDrawing.drawLine(0, 0, -10, -10, 10, -5, block.STONE.id) #circle mcDrawing.drawCircle(-15, 15, -15, 10, block.WOOD.id) #sphere mcDrawing.drawSphere(-15, 15, -15, 5, block.OBSIDIAN.id) #face - solid triangle faceVertices = [] faceVertices.append(minecraft.Vec3(0, 0, 0)) faceVertices.append(minecraft.Vec3(5, 10, 0)) faceVertices.append(minecraft.Vec3(10, 0, 0)) mcDrawing.drawFace(faceVertices, True, block.SNOW_BLOCK.id) #face - wireframe square - using Points faceVertices = Points() faceVertices.add(0, 0, 5) faceVertices.add(10, 0, 5) faceVertices.add(10, 10, 5) faceVertices.add(0, 10, 5) mcDrawing.drawFace(faceVertices, False, block.DIAMOND_BLOCK.id)
from mcpi.minecraft import Minecraft from time import sleep from random import randint from minecraftstuff import MinecraftDrawing print("hi ok") mc = Minecraft.create() md = MinecraftDrawing(mc) x, y, z = mc.player.getTilePos() sleep(5) #md.drawHollowSphere(x,y,z,10,24) md.drawSphere(x, y, z, 10, 0) md.drawHollowSphere(x, y + 20, z, 10, 24)
#test MinecraftDrawing #clear area mc.setBlocks(-25, 0, -25, 25, 25, 25, block.AIR.id) #create drawing object mcDrawing = MinecraftDrawing(mc) #line mcDrawing.drawLine(0,0,-10,-10,10,-5,block.STONE.id) #circle mcDrawing.drawCircle(-15,15,-15,10,block.WOOD.id) #sphere mcDrawing.drawSphere(-15,15,-15,5,block.OBSIDIAN.id) #face - solid triangle faceVertices = [] faceVertices.append(minecraft.Vec3(0,0,0)) faceVertices.append(minecraft.Vec3(5,10,0)) faceVertices.append(minecraft.Vec3(10,0,0)) mcDrawing.drawFace(faceVertices, True, block.SNOW_BLOCK.id) #face - wireframe square - using Points faceVertices = Points() faceVertices.add(0,0,5) faceVertices.add(10,0,5) faceVertices.add(10,10,5) faceVertices.add(0,10,5) mcDrawing.drawFace(faceVertices, False, block.DIAMOND_BLOCK.id)
#test MinecraftDrawing #clear area mc.setBlocks(-25, 0, -25, 25, 25, 25, "air") #create drawing object mcDrawing = MinecraftDrawing(mc) #line mcDrawing.drawLine(0,0,-10,-10,10,-5,"stone") #circle mcDrawing.drawCircle(-15,15,-15,10,"WOOD") #sphere mcDrawing.drawSphere(-15,15,-15,5,"OBSIDIAN") #face - solid triangle faceVertices = [] faceVertices.append(Vec3(0,0,0)) faceVertices.append(Vec3(5,10,0)) faceVertices.append(Vec3(10,0,0)) mcDrawing.drawFace(faceVertices, True, "snow_block") faceVertices = [] faceVertices.append(Vec3(0,0,5)) faceVertices.append(Vec3(10,0,5)) faceVertices.append(Vec3(10,10,5)) faceVertices.append(Vec3(0,10,5)) mcDrawing.drawFace(faceVertices, False, "diamond_block")
from minecraftstuff import MinecraftDrawing from minecraftstuff import MinecraftShape, ShapeBlock from random import randint from time import sleep mc = minecraft.Minecraft.create() mcDrawing = MinecraftDrawing(mc) def prepare(): mcDrawing.drawSphere(0, 0, 0, 10, block.SAND) mc.setBlock(4, 3, 1, block.BEDROCK) mc.setBlock(9, 8, 9, block.GLASS) def game(): while True: pass mcDrawing.drawSphere(10, 10, 10, 5, block.DIAMOND_BLOCK) mcDrawing.drawSphere(10, 10, 10, 3, block.AIR) def main(): prepare() #game() main()