On 2013-02-14, at 07:52, Casey Ransberger <casey.obrie...@gmail.com> wrote:

> The next big thing probably won't be some version of Minecraft, even if 
> Minecraft is really awesome. OTOH, you and your kids can prove me wrong today 
> with Minecraft Raspberry Pi Edition, which is free, and comes with _source 
> code_.
> 
> http://mojang.com/2013/02/minecraft-pi-edition-is-available-for-download/
> 
> </fanboy>

It does not come with source code. But it is free (as in beer) and there is an 
API (implemented as a local TCP server) that lets you modify the world from any 
language (they include bindings for Python and Java). You probably can even use 
telnet ;)

See protocol spec attached below.

- Bert -

MCPI-PROTOCOL 0.1

OVERVIEW
The mcpi-protocol enables an external process (program) to interact with a
running instance of Minecraft Pi Edition.

The protocol can easily be implemented and used from any programming language
that has network socket support. The mcpi release includes api libraries (with
source) for Python and Java.

* Tcp-socket, port 4711
* Commands are clear text lines (ASCII, LF terminated)


DEFINITIONS
x,y,z -- vector of three integers.
xf,yf,zf -- vector of three floats.
blockTypeId -- integer 0-108. 0 is air.
blockData -- integer 0-15. Block data beyond the type, for example wool color.

See: http://www.minecraftwiki.net/wiki/Data_values_(Pocket_Edition)


COORDINATE SYSTEM
Most coordinates are in the form of a three integer vector (x,y,z) which
address a specific tile in the game world. (0,0,0) is the spawn point sea
level. (X,Z) is the ground plane and Y is towards the sky.


COMMANDS
-- World --
world.getBlock(x,y,z) --> blockTypeId

world.setBlock(x,y,z,blockTypeId)
world.setBlock(x,y,z,blockTypeId,blockData)

world.setBlocks(x1,y1,z1,x2,y2,z2,blockTypeId)
world.setBlocks(x1,y1,z1,x2,y2,z2,blockTypeId,blockData)

world.getHeight(x,z) --> Integer

world.checkpoint.save()
world.checkpoint.restore()

world.setting(KEY,0/1)

chat.post(message)

-- Camera --
camera.mode.setNormal()
camera.mode.setThirdPerson()
camera.mode.setFixed()
camera.mode.setPos(x,y,z)

-- Player --
player.getTile() --> x,y,z
player.setTile(x,y,z)

player.getPos() --> xf,yf,zf
player.setPos(xf,yf,zf)

-- Entities --
TBD


-- Events --
events.block.hits() --> pos,surface,entityId|pos,surface,entityId|... (pos is 
x,y,z surface is x,y,z, entityId is int)
events.clear()
_______________________________________________
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc

Reply via email to