Dedicated server connection problems? (server works client not)

66 views
Skip to first unread message

Jonathan Downing

unread,
Aug 18, 2016, 10:29:59 AM8/18/16
to Coding in Minecraft
ok, i have set up my dedicated server and it works correctly, made a diamond monument as an example.

i am having problems connecting other computers to the server in order that my two children can connect and learn in their own time and space.

there is nothing wrong with the server, i can connect to it from other machines, install and run scratch but when i try to run the python file (mcpi-scratch.py) i get the following error and nothing in scratch works...

======== RESTART: C:\Minescratch\mcpi-scratch-master\mcpi-scratch.py ========
INFO:__main__:Namespace(host=None)
ERROR:__main__:cannot connect to minecraft
Traceback (most recent call last):
  File "C:\Minescratch\mcpi-scratch-master\mcpi-scratch.py", line 267, in <module>
    mc = minecraft.Minecraft.create()
  File "C:\Minescratch\mcpi-scratch-master\mcpi\minecraft.py", line 171, in create
    return Minecraft(Connection(address, port))
  File "C:\Minescratch\mcpi-scratch-master\mcpi\connection.py", line 17, in __init__
    self.socket.connect((address, port))
  File "C:\Python27\lib\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 10061] No connection could be made because the target machine actively refused it
Traceback (most recent call last):
  File "C:\Minescratch\mcpi-scratch-master\mcpi-scratch.py", line 267, in <module>
    mc = minecraft.Minecraft.create()
  File "C:\Minescratch\mcpi-scratch-master\mcpi\minecraft.py", line 171, in create
    return Minecraft(Connection(address, port))
  File "C:\Minescratch\mcpi-scratch-master\mcpi\connection.py", line 17, in __init__
    self.socket.connect((address, port))
  File "C:\Python27\lib\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 10061] No connection could be made because the target machine actively refused it

in short (
-server works and can connect from any machine
-python and scratch can only work on localhost

Help needed

Jim Christian

unread,
Aug 18, 2016, 11:30:49 AM8/18/16
to Coding in Minecraft
Hi Johnathan

That's an interesting set up. I hadn't anticipated anyone running additional clients to a server, which was perhaps a massive oversight!

The "No connection could be made because the target machine actively refused it" line suggests to me that the connection is being blocked by a firewall on the server. It's worth turning Windows firewall off temporarily just to check this is the case and then - if it works - determining which port it's connecting over to make an exception.

Please let us know what you find.

Regards
Jim

Jonathan Downing

unread,
Aug 18, 2016, 11:48:59 AM8/18/16
to Coding in Minecraft
after much googling, and not a few missteps on my part i have found the problem, I had assumed that i wouldn't need to install the server software on my client machine.
Found a site that informs educators how to set up, and includes how to connect to someone elses server (within the classroom, assuming you know the IP address) so to summarise i have to install the server software and have it running even if i want to run the software on a client machine (raspberry juice API at work here)
so now to try it and will report on how it goes.

Jonathan Downing

unread,
Aug 18, 2016, 5:17:47 PM8/18/16
to Coding in Minecraft
ok, since i'm using windows and am a python novice, 
i started the server as given in the your manual with minecraft running (just in case)

client-side:

-I started minecraft and manually entered the IP address of the server - this connected as it would any other minecraft game.

-Then i opened a dos prompt and entered the path to python (in my case "path = c:\python27" )

-Then in the mcpi-scratch folder in a command prompt i used the command "python mcpi-scratch.py -m 192.168.x.x " or for anyone else replace the numbers with the ip address (most routers will use the ip range 192.168.x.x)

-opened scratch and imported the extra file

found everything to be working.

:-) i hope that this helps anyone else who may have a similar problem

Jonathan Downing

unread,
Aug 18, 2016, 5:19:30 PM8/18/16
to Coding in Minecraft
oops forgot to mention the client does not need to have the server running, just the python in a command prompt, minecraft and scratch.

Jim Christian

unread,
Aug 19, 2016, 3:12:39 AM8/19/16
to Coding in Minecraft
Great stuff - thank you Jonathan!
Reply all
Reply to author
Forward
0 new messages