Posts: 17
Joined: Fri Nov 30, 2012 1:56 am

Minecraft Pi edition: "Importing minecraft as mc"

Mon Jan 28, 2013 10:47 pm

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 a noob. :)

does anyone know what im doing wrong?


User avatar
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

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

Mon Jan 28, 2013 10:52 pm

Here's the only tutorial I have come across ... asics.html - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
Posts: 1
Joined: Mon Jan 28, 2013 11:42 pm

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

Tue Jan 29, 2013 12:20 am

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

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

User avatar
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

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

Fri Feb 01, 2013 11:10 pm

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) ... 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. ... -seek.html

- a auto bridge builder, which will create a bridge underneath your feet as you go ... ridge.html

Im loving it.
"am I getting slower, or is stuff more complicated; either way I now have to write it down -"

Return to “Troubleshooting”