A set of examples showing the usage of the Perl API and Minecraft-Pi
To use these examples first you need to have Minecraft installed:
If you have a recently updated version of Raspbian you can install Minecraft-Pi from the repositories.
- Open LXTerminal by double clicking on the icon on the desktop or click on : Start Menu > Accessories > LXTerminal
- Type the following commands and press enter after each one:
sudo apt-get updatesudo apt-get install minecraft-pi
- You should now see a minecraft shortcut icon on the desktop. Double click on this to start minecraft pi
Alternatively you can start minecraft from the terminal:
- Open LXTerminal by double clicking on the icon on the desktop or click on : Start Menu > Accessories > LXTerminal
- type
minecraft-piand press enter. Note if you wish to start minecraft in the background you need to typeminecraft-pi &
If you have an older version of Raspbian you need to do the following:
- Go to http://pi.minecraft.net
- Click on Downloads in the menu bar
- Click on the download link
- As of 15th May 2014 the link was:
- https://s3.amazonaws.com/assets.minecraft.net/pi/minecraft-pi-0.1.1.tar.gz
- Unzip/Uncompress this file by navigating to it in the File Manager and right clicking on it and click on Extract here
- Go into the newly created folder mcpi
- Double click on the file minecraft-pi and choose Execute
- This will have opened up Minecraft, you need to start a game and create a new world
Now that Minecraft is running and you are in the world you can run the examples. All examples can be run from the command line in LXTerminal.
##Running the Examples in LXTerminal
-
Open LXTerminal by double clicking on the icon on the desktop or click on : Start Menu > Accessories > LXTerminal
-
Navigate to the folder where these examples are, assuming you have uncompressed the zip folder or cloned the repository in your home folder :
cd Perl-Minecraft-Examples -
Type:
perl filename.pland press enter (where filename is the examples to try) -
Where the script expects arguments you supply those after the filename. For example:
perl 02-sendArgsMessageToChat.pl "This is a message" -
Have fun in Minecraft!