I was trying to play with my brother and faced a similar issue. After a while of scrolling for soultions in this thread and tweaking with Firewall settings that I imagined would solve the issue (that ultimately did not), I opted for LogMeIn Hamachi. Since I'm not really smart enough to explain anything about it, I'll provide you with the following:
"It is capable of establishing direct links between computers that are behind network address translation (NAT) firewalls without requiring reconfiguration (when the user's PC can be accessed directly without relays from the Internet/WAN side). Like other VPNs, it establishes a connection over the Internet that emulates the connection that would exist if the computers were connected over a local area network (LAN)." - LogMeIn Hamachi'sWikipedia Page
I'm not very knowledgeable about these sorts of things. All I know is that it worked for me. From the PC of whoever's trying to join, copy the hoster's IPv4 address from the Hamachi client and input it into the text prompt in the direct connection menu, adding the port number at the end (ex. (IPv4 address you copied):(port number generated from opening the world to LAN)). I might be missing some information since it's been a while since I've done this, so if something seems off, check other sources that aren't me.
Do heed my word, though: Only use Hamachi with people you absolutely trust. Word has it that it is possible for anyone else you allow into the private network formed through Hamachi to hack into your computer. From someone who was a rather dumb child that let some of my old accounts on older platforms be hacked due to my lack of intelligence at the time, being hacked isn't fun. I only picked Hamachi because I entirely trust my brother and because none of the other solutions in this thread worked for me.
EDIT: My brother and I were playing on 1.21. I somehow neglected to mention this. Silly me...
So i got the exact same error message but i have a different mc version (1.21). I updated from 1.20.6 and moved to a "new" (A pc I used to use for this server) pc. I did not get this error earlier in 1.20.6 so i'm not sure what happened. I'm self hosting and i have tried some of the firewall solutions but none have worked so far. Has anyone else had this error in 1.21? I'm not sure if this helps but i'm using Java 22 to run the server. I tried some of the soultions (i'm still testing some of them). Any help is appreciated!
Ive realize that this ocurs because the IP networks doesn't match, so you most to have both pcs in DHCP Mode or configured IP but also in the same public/private net. You can do this by having the options "network detection" disabled in the "advanced charing use config" in the "Network advance config" in the Configuration app(click in safe if you are in wi. 10). And then, going to This PC>Network (In the left panel) and clicking in the yellow message above, selecting the No, I'm in a private Network wich is the first option.
i just got kicked from my friends server and cant connect getting the getsockopt message, its not a firewall issue, i have been fiddling that stuff for the past 2 hours, seems like its an issue in the newest MC version if u ask me. but please do share possible solutions
We tried just about every suggested fix in this huge thread. Nothing worked! Firewall fixes. Nope. Direct connection. Nope. Changing java versions on the client (I confess, not the server). Nothing!
The only thing that did work was downgrading to 1.19.4. That worked the first time we attempted a LAN game. No issues.
Yo probably server your trying to connect is like shutdown or idk what happend in my country one server ended and after one month this showed up.. idk what happend to your minecraft
I FOUND THE FIX
THIS VIDEO AND
THEN DOWNLOAD THE LATEST VERSION OF JAVA
from the official site
it is smth like oracle java ...
thank me later
To everyone who has this problem, check out this guide:
https://www.partitionwizard.com/partitionmagic/minecraft-lan-not-working.html
For me the problem was AP Isolation (called client isolation in my router config).
I was trying to play with my brother and faced a similar issue. After a while of scrolling for soultions in this thread and tweaking with Firewall settings that I imagined would solve the issue (that ultimately did not), I opted for LogMeIn Hamachi. Since I'm not really smart enough to explain anything about it, I'll provide you with the following:
"It is capable of establishing direct links between computers that are behind network address translation (NAT) firewalls without requiring reconfiguration (when the user's PC can be accessed directly without relays from the Internet/WAN side). Like other VPNs, it establishes a connection over the Internet that emulates the connection that would exist if the computers were connected over a local area network (LAN)." - LogMeIn Hamachi's Wikipedia Page
I'm not very knowledgeable about these sorts of things. All I know is that it worked for me. From the PC of whoever's trying to join, copy the hoster's IPv4 address from the Hamachi client and input it into the text prompt in the direct connection menu, adding the port number at the end (ex. (IPv4 address you copied):(port number generated from opening the world to LAN)). I might be missing some information since it's been a while since I've done this, so if something seems off, check other sources that aren't me.
Do heed my word, though:
Only use Hamachi with people you absolutely trust. Word has it that it is possible for anyone else you allow into the private network formed through Hamachi to hack into your computer. From someone who was a rather dumb child that let some of my old accounts on older platforms be hacked due to my lack of intelligence at the time, being hacked isn't fun. I only picked Hamachi because I entirely trust my brother and because none of the other solutions in this thread worked for me.
EDIT: My brother and I were playing on 1.21. I somehow neglected to mention this. Silly me...
So i got the exact same error message but i have a different mc version (1.21). I updated from 1.20.6 and moved to a "new" (A pc I used to use for this server) pc. I did not get this error earlier in 1.20.6 so i'm not sure what happened. I'm self hosting and i have tried some of the firewall solutions but none have worked so far. Has anyone else had this error in 1.21? I'm not sure if this helps but i'm using Java 22 to run the server. I tried some of the soultions (i'm still testing some of them). Any help is appreciated!
Ive realize that this ocurs because the IP networks doesn't match, so you most to have both pcs in DHCP Mode or configured IP but also in the same public/private net. You can do this by having the options "network detection" disabled in the "advanced charing use config" in the "Network advance config" in the Configuration app(click in safe if you are in wi. 10). And then, going to This PC>Network (In the left panel) and clicking in the yellow message above, selecting the No, I'm in a private Network wich is the first option.
i just got kicked from my friends server and cant connect getting the getsockopt message, its not a firewall issue, i have been fiddling that stuff for the past 2 hours, seems like its an issue in the newest MC version if u ask me. but please do share possible solutions
I have found something that worked for me: Adding "-Djava.net.preferIPv4Stack=true" in the JVM arguments in the launcher...
We tried just about every suggested fix in this huge thread. Nothing worked! Firewall fixes. Nope. Direct connection. Nope. Changing java versions on the client (I confess, not the server). Nothing!
The only thing that did work was downgrading to 1.19.4. That worked the first time we attempted a LAN game. No issues.
Where is 'java.exe'?
Does anyone else know how to do it on 1.21 because i tried to do everything the others forums posts said but none worked if you can help please do
Yo probably server your trying to connect is like shutdown or idk what happend in my country one server ended and after one month this showed up.. idk what happend to your minecraft
Moin ichhab das Selbe Problem aber mit nemNitrado Server in der version 1.21 kann man das fixen?
I cannot find this file. It does not show up what so ever.
Tried all suggestion here, with no success. Thanks minecraft for taking away a game my daughter and I play together.
we've done that for our LAN server and it's still not working. weirdly when i host a server it doesn'
t show up for them. i've tried everything and i'm at a complete loss of what to do
Hey guys, the fix for me was to use my public IPV6 address to connect as opposed to my IPV4 address.
Also please note, in my "server.properties" file I put in the IPV6 address for the "server-ip" field.
If you paste the address into the file you need to make sure there are backslashes before each colon by the way.
so for example: