Minecraft

Experiments

http://www.raspberrypi-spy.co.uk/2014/06/building-a-castle-in-minecraft-with-python/

connection

from mcpi.minecraft import Minecraft
from mcpi import block
mc = Minecraft.create(address="192.168.2.23")

say “Hello World”

mc.postToChat("Hello world")

get position

x, y, z = mc.player.getPos()

goto (jump)

mc.player.setPos(x, y+100, z)

put a block

mc.setBlock(x+1, y, z, 1)
mc.setBlock(x+1, y, z, block.STONE.id)
mc.setBlock(x+1, y, z, block.STONE.id, 2) # color 2

multi block

stone = 1
mc.setBlocks(x+1, y+1, z+1, x+11, y+11, z+11, stone)

Game

download launcher form https://minecraft.net/it-it/download/ in ~/minecraft

java -jar Minecraft.jar

pauseOnLostFocus:false

launcher

#!/bin/sh java -jar ~/.minecraft/launcher.jar

Python

sudo apt install -y python3
sudo apt install -y idle3
sudo apt install -y python3-pip
sudo pip3 install -U pip
## sudo pip3 install https://github.com/py3minepi/py3minepi/archive/master.zip

Download mods.zip and python-scripts.zip from https://github.com/arpruss/raspberryjammod/releases

cd ~/.minecraft mkdir -p mods cd mods unzip ~/Downloads/mods.zip cd ~/.minecraft unzip ~/Downloads/python-scripts.zip

Server

mkdir ~/minecraft
cd ~/minecraft
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev 1.11.2

#!/bin/sh java -Xms512M -Xmx1G -XX:+UseConcMarkSweepGC -jar spigot*.jar
gamemode=1 force-gamemode=true

download raspberryjuice (1.10) from https://dev.bukkit.org/projects/raspberryjuice/files and put in ~/minecraft/plugins

plugins:

https://dev.bukkit.org/projects/multiworld-v-2-0

mw list
mw create daniele
mw load daniele

https://dev.bukkit.org/projects/permissionsex <file yaml PermissionsEx/permissions.yml> groups: Default: options: default: true permissions:

modifyworld. Admin: options: prefix: '&0(&4Admin&0)&7 ' permissions: - permissions.

multiworld. users: scipioit: group: - Admin permissions: - permissions. options: name: scipioit schema-version: 1 </file>