开源软件名称(OpenSource Name):martinohanlon/minecraft-stuff开源软件地址(OpenSource Url):https://github.com/martinohanlon/minecraft-stuff开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):Minecraft - Stuff LibraryAn extension library of useful 'stuff' (aka classes) I have created for Minecraft: Pi Edition's API. It provides functions for drawing lines, creating, moving and rotating shapes and a pretty cool turtle. Check out the documentation and examples. Created by Martin O'Hanlon, @martinohanlon, stuffaboutco.de. InstallOpen a terminal and run the following commands: sudo pip install minecraftstuff sudo pip3 install minecraftstuff CodeSee the documentation for more information, but below is a summary. MinecraftDrawingfrom minecraftstuff import MinecraftDrawing from mcpi.minecraft import Minecraft from mcpi import block #Connect to minecraft mc = Minecraft.create() # get the players position pos = mc.player.getTilePos() #Using the Minecraft Drawing API mcdrawing = MinecraftDrawing(mc) # draw a circle with a radius of 10 blocks mcdrawing.drawCircle(pos.x, pos.y + 15, pos.z, 10, block.WOOD.id) MinecraftShapefrom minecraftstuff import MinecraftShape from mcpi.minecraft import Minecraft from mcpi import block from time import sleep #Connect to minecraft mc = Minecraft.create() # get the players position pos = mc.player.getTilePos() #Using the Minecraft Shape API mcshape = MinecraftShape(mc, pos) # create a stone cube mcshape.setBlocks(-5, -5, -5, 5, 5, 5, block.STONE.id) # move it around for i in range(0,10): mcshape.moveBy(1,0,1) sleep(0.5) MinecraftTurtlefrom minecraftstuff import MinecraftTurtle from mcpi.minecraft import Minecraft #Connect to minecraft mc = Minecraft.create() # get the players position pos = mc.player.getTilePos() #Using the Minecraft Turtle steve = MinecraftTurtle(mc, pos) # draw a square steve.forward(5) steve.right(90) steve.forward(5) steve.right(90) steve.forward(5) steve.right(90) steve.forward(5) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论