martinohanlon / mcpi

Minecraft: Pi Edition API Python Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Got [Errno 54] Connection reset by peer on macOS

opened this issue · comments

Hello,

I have used craftbukkit (version 1.18.1), mcpi (v1.2.1) and Raspberry Juice (v1.12) on the latest MacOS.

I can launch a Minecraft server with craftbukkit and load the raspberry juice as a plugin. My Minecraft version is also 1.18.1.

My macbook system is 12.0.1 and the cpu is arm-based.

However, it seems that the python script cannot be transferred to the Minecraft and I got the following error:

Drained Data: <b'\xbd\x01\x1a\xba\x01{"translate":"disconnect.genericReason","with":["Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: Index 111 out of bounds for length 1"]}'>
Last Message: <b'world.setBlock(-30,44,0,35,10)'>
Traceback (most recent call last):
File "/Users/frank/Documents/MyPythonCraft/rainbow.py", line 14, in
mc.setBlock(x - 64, y, 0, block.WOOL.id, colors[len(colors) - 1 - colourindex])
File "/Users/frank/Documents/MyPythonCraft/mcpi/minecraft.py", line 301, in setBlock
self.conn.send(b"world.setBlock", intFloor(args))
File "/Users/frank/Documents/MyPythonCraft/mcpi/connection.py", line 40, in send
self._send(s)
File "/Users/frank/Documents/MyPythonCraft/mcpi/connection.py", line 47, in _send
self.drain()
File "/Users/frank Documents/MyPythonCraft/mcpi/connection.py", line 26, in drain
data = self.socket.recv(1500)
ConnectionResetError: [Errno 54] Connection reset by peer

Thanks a lot for your help.

Make sure you launch Minecraft and open a world that uses RaspberryJuice before running your script. From my experience on Minecraft: Pi Edition.

It's an error with either RaspberryJuice or your server software. This has nothing to do with this library.