tips:gameengine:minecraft

Minecraft

connection

from mcpi.minecraft import Minecraft
from mcpi import block

mc = Minecraft.create(address="192.168.2.35")

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)

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

java -jar Minecraft.jar
~/.minecraft/options.txt
pauseOnLostFocus:false

launcher

~/minecraft/minecraft.sh
#!/bin/sh
java -jar ~/.minecraft/launcher.jar
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
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
spigot.sh
#!/bin/sh
 
java -Xms512M -Xmx1G -XX:+UseConcMarkSweepGC -jar spigot*.jar
~/minecraft/server.properties
gamemode=1
force-gamemode=true

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

plugins:

mw list
mw create daniele
mw load daniele
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
  • tips/gameengine/minecraft.txt
  • Last modified: 2017/08/19 09:53
  • by scipio