PrismarineJS / bedrock-protocol

Minecraft Bedrock protocol library, with authentication and encryption
https://prismarinejs.github.io/minecraft-data/?v=bedrock_1.17.10&d=protocol
MIT License
309 stars 72 forks source link

Binding error when starting server #120

Open kishelly opened 3 years ago

kishelly commented 3 years ago

Hi! I was trying to create a server with the server example code here: https://github.com/PrismarineJS/bedrock-protocol/blob/master/examples/serverReadmeExample.js.

I run it with node serverReadmeExample.js after doing npm install bedrock-protocol

but I can't get to get it to connect in the Minecraft game on an iPhone. this is the error I get when starting the server:

Unknown bind__() error -1; port 19132.

When I add the server to the list with the right address, it gets stuck at connecting and then disconnects, and nothing else is printed in the terminal.

Any suggestions? I'm not very good at JavaScript, maybe I'm doing something wrong or is iPhone client just not supported? ty!

extremeheat commented 3 years ago

Hi, what version are you connecting from? Are you sure you're connecting to the right IP address and port? (19132). Do you see the server MOTD on the server list when you add it?

And yes, Minecraft bedrock edition encompasses both the mobile, console and windows store version of Minecraft so it should work. Perhaps we should clarify this in the readme.

kishelly commented 3 years ago

@extremeheat thanks for the quick reply. I'm fairly sure this is because the error I posted. it says it can't correctly bind the port but nothing is actually blocking it?🤔 my minecraft game version is 1.17.10. where can I find the MOTD?

kishelly commented 3 years ago

think I've gotten it to work. thanks for the help! it's a bit odd that error is printed, though.

extremeheat commented 3 years ago

Yes, I agree this misleading error needs to be removed. I'm not sure exactly where the message originates, but it's possible it's an issue related to IPv6 binding inside of raknet. However, as long as binding to the IPv4 address works, clients should be able to connect.