I recently downloaded the Minecraft Pi edition for my Raspberry Pi. The main feature of the Minecraft Pi edition is the ability to interactively edit the landscape using Python. One would expect that if you can control a game through Terminal on the Raspberry Pi, you should be able to control it through terminal over ssh. Is this possible?

  • 1
    In a word, yes.
    – Tom Medley
    Feb 12, 2013 at 15:23

1 Answer 1


It is entirely possible to control the Minecraft Pi edition interactively through ssh, with one caveat. To control Minecraft Pi edition, you must first launch Minecraft Pi edition. However, you can only launch it from the Raspberry Pi itself. Once it is launched, however, you will be able to control it through ssh. To do so, first ssh into your Raspberry Pi. Then navigate to the folder containing the Minecraft Pi edition. In this folder are a number of subfolders. You want to navigate to api/python/. Now launch Python in interactive mode, by typing python. To control Minecraft Pi edition, you must then type import mcpi.minecraft as minecraft. Now you can establish a connection to the game by typing mc = minecraft.Minecraft.create(). From this point you can issue commands by typing mc, followed by the command name. For example, mc.postToChat("Hi").

Incidentally, you don't even need ssh in order to control Minecraft Pi edition remotely. If you download Minecraft Pi edition onto your regular PC, you can edit the API to connect to your Pi without ssh. To do this, navigate through api/python/mcpi, and open python.py. Now search for the word localhost, and replace it with the IP address of your Raspberry Pi. Now you can run code locally on your regular computer, and it will still communicate with Minecraft on the Pi. (Assuming Minecraft is running.)

  • 6
    I just tried Minecraft on the pi. I could start it over ssh, once I had said startx in another ssh session. This opened a black window on the pc where I ran ssh, and showed the Minecraft graphics on a TV connected to the raspberry. The black window then accepted both mouse and keyboard input, so I could play completely over ssh.
    – Frepa
    Feb 12, 2013 at 16:59
  • That is really cool!
    – daviewales
    Feb 13, 2013 at 1:01
  • 1
    @Frepa any idea how to play Minecraft over SSH without a TV? My main goal is to be able to write Python scripts and see it control Minecraft, but all from my laptop...
    – Dave
    Dec 17, 2013 at 19:08
  • @Dave do you mean you want the Minecraft graphics to render on your laptop screen, rather than on your Pi's screen?
    – daviewales
    Dec 19, 2013 at 4:05
  • @Dave : While presumably you can run an x client on your laptop, it's probably nicer just to set everything up on your laptop, without the Pi. You can either use a craftbukkit server with the Raspberry Juice mod, or using a Minecraft modded with my Raspberry Jam mod. Mar 30, 2015 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.