Build a Custom Minecraft Controller

Build a Custom Minecraft Controller

Build a Custom Minecraft Controller With the GrovePi

What You’ll Need For This Project

  1. Raspberry Pi (and accessories)
  2. SD Card
  3. Raspberry Pi Power Supply
  4. Wifi Dongle
  5. GrovePi+ Board
  6. (3) Grove Buttons
  7. Grove Joystick
  8. Wireless Keyboard and Mouse

Or you could all this by getting the Starter Kit or, if you already have a Raspberry Pi, you could get the Base Kit.  In this tutorial we are using Raspbian for Robots, our version of Raspbian for the Raspberry Pi; it comes with all the software installed for using the GrovePi.  If you don’t have the SD Card from Dexter Industries, you can install it for free by downloading it here.

GrovePi Minecraft Controller for the Raspberry Pi Hardware


What Are We Doing?

Dex_in_Minecraft-1-1024x576In this project we’re going to show you how to build a custom Minecraft Controller.  With some parts, the Raspberry Pi, and the GrovePi+, we will make a custom controller that automates some tasks and makes it easier and faster to build, destroy, and fly in Minecraft.

You can use the programming language Python to write custom programs that control the Minecraft world, build things with blocks, move your player around, and do some other tasks.

The MagPi recently wrote a great introduction to Minecraft on the Raspberry Pi here.

In this project, we wanted to automate three tasks:

  1. Building Big Blocks (blocks that are 5 x 5 x 5).
  2. Destroying Big Blocks: laying waste to areas that are 5 x 5 x 5 with the push of a button.
  3. Flying: we wanted to be able to zoom around our world in fast, and move really fast when we fly.

In order to make our custom controller, we are going to use the GrovePi+ as our controller.  We will use the Python language to read the buttons and joystick on our controller.  And the same program will read things like the position of Steve and place things like blocks.  Finally we’ll build and decorate a nice control box for the project.


The Hardware Setup


grovepi-minecraft-controller-custom-hardware-setupWe’re going to wire up the sensors to the GrovePi.

Prepare the hardware by wiring up the sensors to the GrovePi.

  • Place the GrovePi on the Raspberry Pi.
  • Connect a Button Sensor to port A0.
  • Connect a Joystick to port A2.
  • Connect a Button sensor to Port D3.
  • Connect a Button sensor to Port D4.

Putting it in a Box

minecraft-controller-hardware-box-with-the-grovepiFor this project, we wanted to create a nice looking box.  This part is totally optional, but will help you hold your sensors in place.

We used a small box that could fit the GrovePi and Raspberry Pi in it.  Then we cut a small hole in the box for power and the HDMI cable, and we cut four small holes in the side, one for each sensor.  Add the keyboard  and mouse, and add your wifi dongle.  We hold the grove sensors in place with short strips of wire, twisted behind inside the box.

Each of the sensors are mounted with twisted wire, or alternatively you can use twist ties.

minecraft-controller-custom-box-with-twist-ties-and-button-sensor     minecraft-controller-custom-box-with-twist-ties

We also placed a label next to our controllers to remember which controller does which:  a label for “Build”, “Destroy”, and the “Fly” buttons.  And also a label for our joystick.


Prepare Your Pi

We need to make a few updates to the Raspberry Pi.

Before we begin, we will need to install Minecraft on the Raspberry Pi, and a few updates to get it running.  Open the command line and run the following commands:

sudo apt-get install minecraft-pi 

sudo pip3 install python3-xlib

sudo pip3 install pyautogui

Now you should have all the tools installed you need to run Minecraft and interact with it in Python.


Running The Software

Let’s get the software and take a look at how it works.

Get the Code

First, let’s get the software from Github.  If you’re using Raspbian for Robots, you can simply update your software.   If not, to get the code, simply run the following commands in the command line:

cd ~

sudo wget

This should download the python program.  We can open it in IDLE3 and take a look. On the Raspberry Pi Desktop, open Python 3 (IDLE).


opening minecraft custom controller code

Next, open Minecraft.


minecraft controller with the raspberry pi open minecraft

In Minecraft, select your world, or create a new world.

open minecraft world

Finally, run the program in IDLE.  Keep Minecraft open while starting the IDLE program!



After running the IDLE program, you should see feedback coming from the IDLE screen.  This is analog reading and button readings from the GrovePi+ controller!


Using Your Controller

You’re ready to use your custom Minecraft controller now!





Ask on our forums!  We’re always there and always ready to help!