Interacting with Minecraft

Minecraft on the Raspberry Pi

If you're not using a Raspberry Pi for this tutorial, you'll need to skip this section. We're going to talk about interacting with the Minecraft world using another library, or module, called mcpi, that is only available on the Raspberry Pi.

However, if you're still interested in working with Minecraft and Python locally, you might want to check out this book:

  • Learn to Program with Minecraft: Transform Your World with the Power of Python by Craig Richardson
  • The mcpi library is a programming interface into the version of Minecraft that is available for the Raspberry Pi. This means that you can use Python to write commands and scripts to build things in the game. It's a great way to practice what you're learning here!

    To get started, open Minecraft from the desktop menu - you'll find it under 'Games'.

    When Minecraft has loaded, click on Start Game, followed by Create New. To drag the game around, you'll need to grab the title bar behind the Minecraft window.

    Once you're in the game, you can walk around and build things. Use your mouse to interact with your inventory, and double tap your keyboard's space bar to jump or fly around.

    With Minecraft running, move your focus away from the game by pressing the Tab key, which will free your mouse. Open Idle3 (if it's not already open) and move the windows so they're side-by-side.