Page 1 of 1

Minecraft Pi edition: "Importing minecraft as mc"

Posted: Mon Jan 28, 2013 10:47 pm
by brettsalyer
Hello everyone,

I recently put Minecraft: Pi edition on my Pi and now i want to run commands. Im fairly new to linux and python, so im obviously im running into some errors. Ok, i start up minecraft and get in game. i pull up a terminal windows and type "python" and load python. Then i type "Import minecraft as mc" and it says there is no module named "minecraft" . like i said..im a noob. :)

does anyone know what im doing wrong?

Thanks!

Re: Minecraft Pi edition: "Importing minecraft as mc"

Posted: Mon Jan 28, 2013 10:52 pm
by malakai
Here's the only tutorial I have come across

http://www.stuffaboutcode.com/2013/01/r ... asics.html

Re: Minecraft Pi edition: "Importing minecraft as mc"

Posted: Tue Jan 29, 2013 12:20 am
by Morpheu5
You have to go into the directory with the .py Files before you start the python shell
For example:

Code: Select all

cd ~/mcpi/api/python/mcpi
Then you can run python, import the files and play with the api:

Code: Select all

python
>>> import minecraft as mc
>>> mc = mc.Minecraft.create()
>>> mc.postToChat("Hello")

Re: Minecraft Pi edition: "Importing minecraft as mc"

Posted: Tue Jan 29, 2013 3:07 pm
by brettsalyer
Oh, ok thanks!

Re: Minecraft Pi edition: "Importing minecraft as mc"

Posted: Fri Feb 01, 2013 11:10 pm
by LetHopeItsSnowing
Ive been playing around with the minecraft api for a little while, there is plenty you can do with it.

In additional to the tutorial I put on my blog about how to to get started (which has already been noted) http://www.stuffaboutcode.com/2013/01/r ... asics.html.

Ive also written:
- a simple hide and seek game, where a diamond block is hidden and you have to go and find it, the program will tell you whether you are getting warmer or colder and how far away it is. http://www.stuffaboutcode.com/2013/01/r ... -seek.html

- a auto bridge builder, which will create a bridge underneath your feet as you go http://www.stuffaboutcode.com/2013/02/r ... ridge.html

Im loving it.