J
J
JapPhil2019-11-20 16:19:53
linux
JapPhil, 2019-11-20 16:19:53

Why won't mcpi.minecraft connect to minecraft server?

Hello everybody. Raised a minecraft server on localhost, port 4711. Works great, however, there are problems with python3 on the server.

from mcpi.minecraft import Minecraft
mc = Minecraft.create()

I understand that Minecraft.create() directly connects to the server, because the error is:
>>> Minecraft.create()
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.7/site-packages/mcpi/minecraft.py", line 205, in create return Minecraft(Connection(address, port)) File "/usr/lib/python3.7/site-packages/mcpi/connection.py", line 17, in __init__ self.socket.connect((address, port)) ConnectionRefusedError: [Errno 111] Connection refused

I also tried to write Minecraft.create(localhost, 4711), Minecraft.create(127.0.0.1, 4711) and a few other options, but to no avail.
Can you please help and explain what is the problem?
Operating system - Manjaro Linux. Port 4711 is open.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-11-20
@q2digger

Show
netstat -lpn | grep 4711

V
Vova, 2022-01-05
@JustMoose

It seems that the port has changed, and now it is 25565.
In any case, you should look for the server.properties file in the spigot folder, and inside look for the server-port=...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question