Cover image
Try Now
2015-01-21

Minecraft Forge插件复制Minecraft Pi API

3 years

Works with Finder

12

Github Watches

16

Github Forks

91

Github Stars

#Minecraft Pi API mod

This is a Minecraft Forge mod that reimplements (a subset of) the Minecraft Pi edition API.

The Minecraft Pi Edition also contains a simple to use API. My plugin recreates this simple API in your desktop Minecraft, so you can now program your Desktop edition Minecraft easily using the Pi API.

##Screenshots

Outside the skyscraper and shuttle, built using Martin O'Hanlon's massive 3d structures project.

Massive structures

Running the sokoban demo from the standard API library

Sokoban

I've added an in-game command /python which calls an mcpi python script you place in a special directory. This example clears a cubiod of blocks in front of you.

Clear a cuboid of blocks

##Installing

This plugin works with the 1.7.10 version of Minecraft.

If you haven't installed Minecraft Forge, take a look at the installation instructions for Forge.

Once you've successfully installed Minecraft Forge, download the jar file to your minecraft/mods folder.

If you've already programmed the Pi edition with one of the client libraries - the plugin starts up on the same port (4711) so your code should work unchanged.

If you're new to programming the Pi API - Martin O'Hanlon has a nice introductory series of articles that should get you started.

I've included the python version of the Pi Edition client library and a few demos under the mcpimods/python directory. It adds support for some additional commands supported by the mod - but the mod should also work against the standard Pi edition client library.

To get the standard Pi Edition client library - download the free Minecraft Pi Edition and you should find java and python clients, as well as a few demos under its mcpi/api directory.

Not all the commands from the standard client are implemented, and I've probably botched up the right way to do many things -- this was my first foray into writing a forge plugin. But I hope you find it useful and fun nevertheless.

Functionally, this mod is similar to the RaspberryJuice plugin. However, RasperryJuice runs on a Bukkit server, whereas this mod runs under any client running Minecraft Forge.

##Enhancements

The forge mod tries to be compatible with the extended commands supported by the RaspberryJuice plugin.

I've also added an in-game command /python which calls scripts you place under a directory called mcpimods/python in your root Minecraft installation.

The mcpimods/ directory should be next to your Forge mod/ directory. For example, if (on a Mac) your Forge mod directory looks like Library/Application Support/minecraft/mods/, you would place your python scripts under Library/Application Support/minecraft/mcpimods/python

From within the game, you simply call the name of your script (without the .py extension) and it will launch the python script as an external process.

This is best suited for running short commands rather than something that runs in an infinite loop; but of course I hope you experiment and find interesting things.

I've bundled the python mcpi library which has a small demo client that clears a cuboid of blocks. You should also be able to copy the mcpimods directory to the root of your minecraft installation and start using the /python in-game command from the mod.

I've added some experimental commands:

world.setTileEntityHex(x,y,z,hex), which takes an x,y,z position relative to the spawn point, and an ASCII hex string representing a tile entity in NBT format. The main purpose was to have some (weak) support for importing schematic files, and you can see an experimental script that tries to load schematic files. It doesn't always do the right thing, but it's good enough to have some fun creating structures from schematic files

Reading an autofarm schematic via the in-game /python command. Reading a schematic

events.block.wait.hit() waits until a block is hit, and returns the x,y,z position of the block. This can be useful to avoid busy wait loops from your code.

events.entity.wait.movedTile() waits until a player has moved their tile position, and reports a , separated string like entityid,x,y,z. The x,y,z position is the current tile position of the player with entityid. This too is handy to avoid busy wait loops in your code. Check out this example for a hello world type script for how to use this command.

events.setting(key,value) to configure events. Currently, just one key is available -- restrict_to_sword and it takes 0 or 1 as its boolean value. events.setting(restrict_to_sword,0) will remove the (default) check that reports block hit events only when the player is also holding a sword.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • chongdashu
  • 使用模型上下文协议(MCP),启用Cursor,Windsurf和Claude Desktop等AI助手客户,以通过自然语言控制虚幻引擎。

    Reviews

    2 (1)
    Avatar
    user_0A2RjChW
    2025-04-17

    As an avid user of MCP applications, I am thoroughly impressed by mcpiapi. This tool, developed by kbsriram, offers seamless integration with Minecraft Pi Edition, enhancing the overall gaming experience. The ease of use and detailed documentation available on their GitHub page [https://github.com/kbsriram/mcpiapi] make it an invaluable resource. Whether you're a beginner or a seasoned coder, mcpiapi stands out for its reliability and functionality. Highly recommended!