• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

martinohanlon/minecraft-stuff: An extension library of useful 'stuff' (a ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

martinohanlon/minecraft-stuff

开源软件地址(OpenSource Url):

https://github.com/martinohanlon/minecraft-stuff

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

Minecraft - Stuff Library

An 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.

shapes and lines in minecraft

Created by Martin O'Hanlon, @martinohanlon, stuffaboutco.de.

Install

Open a terminal and run the following commands:

sudo pip install minecraftstuff
sudo pip3 install minecraftstuff

Code

See the documentation for more information, but below is a summary.

MinecraftDrawing

from 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)

MinecraftShape

from 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)

MinecraftTurtle

from 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)



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Thinkofname/steven-go: Go Minecraft Client发布时间:2022-08-16
下一篇:
bangbang93/BMCL: Bangbang93's Minecraft Launcher发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap