MCPI Dart Homepage

The Minecraft phenomena has been an amazing success with game players and coders. A version was released for the Raspberry Pi computer that allowed programming via a Python wrapper. The same programming API was added to regular Minecraft servers via Raspberry Juice.

Of course, it would be better if you could program Minecraft in Dart... and now you can! I have put up an early version of mcpi_dart on GitHub and here on pub.dartlang.org.

This entire project was inspired by the awesome book 'Adventures in Minecraft' by Martyn O'Hanlon.

Connecting to the server - Minecraft PI Edition

Make sure the IP is pointing to your Raspberry PI. Run ifconfig command in a shell to show your IP address.

Connecting to the server - Regular Minecraft

Make sure the IP is pointing to your Minecraft server running Bukkit & Raspberry Juice. This was tested on a slightly older Minecraft 1.6.4 on Bukkit Server with Raspberry Juice.

  mci = new Minecraft();
  await mci.connect("192.168.0.110", 4711);

Chat Messages

Talkie talkie! Easy one this.

mci.chat("Dart is awesome!");

Placing Blocks

This is what it is all about. Let's get building!

blockDemo() {
  print("Block Demo Start");
  for (int i = 0; i < 99; i++) {
    mci
      ..setBlock(1, i, 0, Block.GOLD_BLOCK)
      ..setBlock(3, i, 0, Block.DIAMOND_BLOCK)
      ..setBlock(5, i, 0, Block.WOOL);
  }
  print("Block Demo End");
}

Useful Links

Minecraft ID List - a handy reference!