User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

[SOLVED] Please help i cant get minecraft to connect with python.

Thu May 13, 2021 9:19 pm

i've tried everything that uses raspberry pi 4. ive installed python 2 IDLE and i still keep getting this error:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
mc = minecraft.Minecraft.create()
File "/usr/lib/python2.7/dist-packages/mcpi/minecraft.py", line 171, in create
return Minecraft(Connection(address, port))
File "/usr/lib/python2.7/dist-packages/mcpi/connection.py", line 17, in __init__
self.socket.connect((address, port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused
after i use this code:

Code: Select all

from mcpi import minecraft
mc = minecraft.Minecraft.create()
Last edited by BossCoding on Fri May 14, 2021 11:36 pm, edited 1 time in total.

User avatar
richonguzman
Posts: 113
Joined: Fri Aug 28, 2020 4:38 pm
Location: Chile

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 4:30 am

what are you trying to achieve?

scotty101
Posts: 4244
Joined: Fri Jun 08, 2012 6:03 pm

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 7:56 am

The Getting Started with Minecraft Pi guide specifies that you should be using Python 3 (IDLE) not Python 2.

https://projects.raspberrypi.org/en/pro ... craft-pi/1

I'm guessing that you have opened minecraft-pi already.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 5:21 pm

What are you trying to achieve?
my goal is to start placing blocks with code and help others.



and i tried every answer ive seen.

i still can't crack it

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 5:22 pm

The Getting Started with Minecraft Pi guide specifies that you should be using Python 3 (IDLE)

i tried it... but i still get the refused connection from python 2.

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 5:25 pm

Please get back to me when u can.

User avatar
DougieLawson
Posts: 41309
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 8:41 pm

https://magpi.raspberrypi.org/issues/27

There's some code in there that I wrote in a previous life.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 10:44 pm

do you remember which page the code was on???

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 10:45 pm

wait a sec... found it.

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 10:47 pm

DougieLawson wrote:
Fri May 14, 2021 8:41 pm
https://magpi.raspberrypi.org/issues/27

There's some code in there that I wrote in a previous life.
question... is this done through the normal terminal???

User avatar
DougieLawson
Posts: 41309
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 10:52 pm

BossCoding wrote:
Fri May 14, 2021 10:47 pm
DougieLawson wrote:
Fri May 14, 2021 8:41 pm
https://magpi.raspberrypi.org/issues/27

There's some code in there that I wrote in a previous life.
question... is this done through the normal terminal???
Normal GUI, normal LXTerminal.

Some of the set-up stuff isn't needed since Minecraft PE 0.9 is pre-installed on some versions of Raspbian and RaspiOS.

NOTE: Minecraft PE 0.9 has been unsupported since 2013 and was dropped by Mojang/Microsoft in 2015.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 11:03 pm

Think i finally cracked it! thanks Dougie :mrgreen: :mrgreen: :mrgreen: !

User avatar
BossCoding
Posts: 20
Joined: Thu Mar 18, 2021 3:02 am

Re: Please help i cant get minecraft to connect with python.

Fri May 14, 2021 11:38 pm

OTE: Minecraft PE 0.9 has been unsupported since 2013 and was dropped by Mojang/Microsoft in 2015.
well, at least it still works!

Return to “Troubleshooting”