Python plugin for mcpi 0.0.3

python mcpi RaspberryJuice

  1. stoneskin
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.15
    • 1.16
    Source Code:
    https://github.com/stoneskin/minecraft_python_mcpi_plugin
    Contributors:
    stoneskin
    [This plugin still in development]
    This is a plugin to run "mcpi" python file from Minecraft command input in game.

    Pre-Requirements:
    1. need RaspberryJuice plugin to be installed in the spigot plugin
    2, the server need have python installed
    3. the python API MCPI or similar python package needs to be installed
    Code (Text):
    py -m pip install mcpi
    or
    Code (Text):
    py -m pip install mcpi-e
    installation:
    1. copy your python code in a folder of the Minecraft server.
    2. in this plugin config.yml set the command template to run python file
    Code (Text):
    py:
        python_command_template: 'py C:\Python\test\{name}.py'
    usage:
    /py [filename]
    /py reload

    sample:
    /py test 10, 50

    and your test.py code will look like below:

    Code (Text):
    from mcpi_e.minecraft import Minecraft
    from mcpi_e import block
    import sys

    serverAddress = "127.0.0.1"
    playerName = "any"
    pythonApiPort = 4711

    blockId=block.SANDSTONE.id
    size=5

    if len(sys.argv)-1>0:
        playerName=sys.argv[1]
    if len(sys.argv)-1>1:
        try:
            size=int(sys.argv[2])
        except:
            print("1nd argument is not a number, will use default size=5")
    if len(sys.argv)-1>2:
        try:
            blockId=int(sys.argv[3])
        except:
            print("2nd argument is not a number, will use default blockId= Sand")
     
    mc = Minecraft.create(serverAddress,pythonApiPort,playerName)

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

Recent Reviews

  1. Hypocisy
    Hypocisy
    5/5,
    Version: 0.0.3
    ====================================
    Excellent plugin!!
    is it support paper?
    ====================================
    1. stoneskin
      Author's Response
      Thanks for give me the good rate, This just a simple plugin for calling your mcpi python code from the Game command, since the mcpi didn't support a lot of blocks bigger than 255 it not support paper which blockTypeId is 339.