This tutorial assumes you have already installed Minecraft Link in your Minecraft Client. If this is not the case, please first read the installation tutorial for the Minecraft Link for Minecraft.
Installation of Minecraft Link on Arduino
We have contacted Arduino IDE developers to include our Minecraft Link for Arduino Library in the Library Manager. All Arduino IDE compatible devices are supported.
- Open Arduino IDE and go to Tools -> Manage Libraries...
- Enter Minecraft Link in the search box (Filter your search...)
- Click Install to install Minecraft Link in Arduino IDE
- Go to File -> Examples -> Minecraft Link -> BareMinumum
- A new sketch will open. Select your Arduino board and upload it on it
Connecting to Arduino from Minecraft Link
Once the Minecraft Link sketch is loaded on the Arduino, we can connect to it from Minecraft.
- Launch the Minecraft with Minecraft Forge and Minecraft Link installed
- On the home screen, press L to open Minecraft Link window
- Connect Arduino to the computer. Make sure the serial port of the Arduino is not in use. Wait until your Arduino does show on the screen, select it and press Connect.
- If the connection is successful, the green CONNECTED text will be shown next to the selected device
Verifying the connection
We can verify the connection by opening one of the Minecraft Worlds with cheats enabled. Once you are in the world, enter the following command in the chat:
When you execute this command, the name of the connected device should be shown. The number of digital and analog pins should be shown too.
Basic pin control test
Most Arduino compatible boards have onboard LED installed and it is usually located on the digital pin 13. We can use this LED to test if the connection to the Minecraft Link is working. First, we need to set the pin 13 to the output mode, so it can control the LED power state. Enter the following command in the Minecraft Chat:
/link pinmode 13 out
Next, we turn the LED on:
/link digitalwrite 13 1
We set the pin 13 to the high state (1). The onboard LED should turn on. We can now turn it back off by entering the following command:
/link digitalwrite 13 0
Minecraft Link uses the same port numbers as native Arduino environment, so you can use your ordinary pinouts for the use with Minecraft Link.
Now that you have successfully connected your Arduino, you can start making your fist Minecraft Link compatible mod.
- If you would like to develop Minecraft Link mod inside MCreator, read the Minecraft Link procedures tutorial
- If you would like to learn more about Minecraft Link commands, check Minecraft Link commands reference
- If you would like to manually code mod for Minecraft Link, check its API getting started guide