Martin O'Hanlon
From the book: "Adventures in Minecraft" written by David Whale and Martin O'Hanlon, Wiley, 2017 http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1119439582.html
Important note - Linux is not officially supported within Adventures in Minecraft and this Starter Kit is provided as is.
This starter kit contains contains a pre-configured Minecraft server and a folder called "MyAdventures" which contains all the Python libraries required to complete all the chapters in "Adventure in Minecraft".
It is highly recommended that you use the Starter Kit as is and follow the instructions in Adventure 1 - "Hello Minecraft World" to setup your computer.
The structure of the StarterKit is as follows:
- AdventuresInMinecraft
- Server : contains the pre-configured minecraft server and raspberry juice plugin
- MyAdventures : folder to save the minecraft programs too
- mcpi : python api library distributed with Minecraft: Pi Edition and minecraftstuff libraries
- anyio : python library which contains the library to control the 7 segment display
- microbit : python library which contains the library to control the microbit
- findPort.py : a python program used in adventure 5 to find the com port a connected arduino uses
- bitio.hex : the bitio microbit program which should be copied to the BBC micro:bit
- StartServer.sh : a bash script used to start the minecraft server
If required the information below can be used as a guide to create your own StarterKit from scratch. It is written as guide, not as a precise series of instructions. There is no guarantee that they are accurate and are provided as is.
You can use either Bukkit or Spigot for the minecraft server.
Create a folder AdventuresInMinecraft
Create a folder AdventuresInMinecraft\Server
Create a folder AdventuresInMinecraft\MyAdventures
-
Compile the Minecraft server based on the instructions here (https://www.spigotmc.org/wiki/spigot-installation/) and put it in
AdventuresInMinecraft\Server
, the compiled bukkit jar file will be named craftbukkit-#.#.#-R#.0.jar where the # s are the current version number; make a note of the version number, you will need this later. -
Rename the compiled.jar file from
craftbukkit-#.#.#-R#.#.jar
tocraftbukkit.jar
. -
Open a text editor and insert the following text:
java -Xms1024M -Xmx1024M -jar craftbukkit.jar
PAUSE
-
Save the file to the
Server
folder asstart.sh
. The start.sh file is a bash program which will startup the Minecraft server when it is run. -
Double-click the
start.sh
file to run it and startup the server. -
Wait for the message
You need to agree to the EULA in order to run the server.
. Edit eula.txt so eula=true. -
Run the
start.sh
file and startup the Minecraft server.
When you first start the Minecraft server it will take a little time to run as it sets up the server and creates a new Minecraft world, when its finished you will see the message Done
in the command window.
When you want to start your Minecraft server in the future you can run the start.sh
file.
To stop the server, enter the word stop
into the command window and press Enter
.
-
Open a text editor, click File, Open and goto the
Server
folder and openserver.properties
. -
Change the
server.properties
file:gamemode=0
togamemode=1
to change the server from survival mode to creative.force-gamemode=false
toforce-gamemode=true
to make all players play in creative mode.spawn-monsters=true
tospawn-monsters=false
so monsters mobs wont appear in the game.spawn-animals=true
tospawn-animals=false
so animals wont appear.spawn-npcs=true
tospawn-npcs=false
so monsters mobs wont appear in the game.allow-flight=false
toallow-flight=true
so you can fly in Minecraft.online-mode=true
toonline-mode=false
so you don t need to be connected to the internet to use Bukkit
Open a text editor and add the following text:
#!/bin/bash
echo "Adventures In Minecraft"
echo "Minecraft Server Version is #.#.#"
echo " Note - make sure Minecraft is using #.#.#"
echo "By continuing you are indicating your agreement to our EULA https://account.mojang.com/documents/minecraft_eula)."
echo "Press any key to continue"
read -n 1 -s
cd "$( dirname "$0" )"
cd Server
./start.sh
Replace #.#.# with the version number of Minecraft server you created.
Save the file as StartServer.sh to the AdventuresInMinecraft folder.
RaspberryJuice is a plugin for Bukkit which will allow you to write programs which will change the Minecraft world as you are playing, just like the API which comes with Minecraft: Pi Edition on the Raspberry Pi.
-
Goto https://www.spigotmc.org/resources/raspberryjuice.22724/
-
download the latest version of the raspberry juice plugin, download the raspberryjuice-#.#.jar file.
-
Copy the raspberryjuice-#-#.jar plugin to the plugins folder in the Bukkit folder.
- Get mcpi from github https://github.com/AdventuresInMinecraft/mcpi
git clone https://github.com/AdventuresInMinecraft/mcpi
Note - the mcpi repository contains the python 3 version of the library supplied by mojang with Minecraft: Pi Edition https://github.com/py3minepi/py3minepi and the minecraftstuff library https://github.com/martinohanlon/minecraft-stuff
-
Copy the mcpi folder to MyAdventures
-
Get the minecraft-stuff module from https://github.com/martinohanlon/minecraft-stuff
git clone https://github.com/martinohanlon/minecraft-stuff
-
Copy "minecraftstuff\minecraftstuff.py" to the mcpi folder.
-
Download anyio from github https://github.com/AdventuresInMinecraft/anyio
git clone https://github.com/AdventuresInMinecraft/anyio
-
Copy the anyio/anyio folder to MyAdventures
-
Copy the anyio/findPort.py file to MyAdventures
-
Download bitio from github https://github.com/AdventuresInMinecraft/bitio
git clone https://github.com/AdventuresInMinecraft/bitio
-
Copy the bitio/src/microbit folder to MyAdventures
-
Copy the bitio/bitio.hex file to MyAdventures