Description
When attempting to connect to any server the Minecraft client will time out. The server will have no record of the attempted connection. The client has the following error in its log:
java.net.SocketException: Address family not supported by protocol family: connect
         at java.net.DualStackPlainSocketImpl.connect0(Native Method)
         at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
         at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
         at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at codechicken.core.CCUpdateChecker$ThreadUpdateCheck.run(CCUpdateChecker.java:47)
Cause
Java is attempting to make a connection to an IPv4 address using the IPv6 protocol.
Solution
Tell Java to use the IPv4 protocol instead using the -Djava.net.preferIPv4Stack=true option. You can do this by editing the Java launch options in your Minecraft or Modpack Launcher. You may also set Java to always use the option:
- Set 
-Djava.net.preferIPv4Stack=truein the Twitch Launcher - Set 
-Djava.net.preferIPv4Stack=truein the Minecraft Launcher - Set 
-Djava.net.preferIPv4Stack=truein the ATLauncher - Set 
-Djava.net.preferIPv4Stack=truein the Technic Launcher - Set Java to always use 
-Djava.net.preferIPv4Stack=true 
Set ‘-Djava.net.preferIPv4Stack=true’ in the Twitch Launcher
- Open the Twitch Launcher
 - Click on the down-arrow at the top right (next to your username) and click 
Settings - On the left-hand menu, click 
Minecraft - Scroll down to the bottom to the 
Advancedsection - Add 
-Djava.net.preferIPv4Stack=trueto the end of theAdditional Java Arguments - Click 
Done 
Set ‘-Djava.net.preferIPv4Stack=true’ in the Minecraft Launcher
- Open the Minecraft Launcher
 - Click on 
Launch Options. (If you can’t see it, click the 3 bars at top right) - Click on the Profile that you want to change
 - Enable the 
JVM argumentsswitch, the box to the right can now be edited - Add 
-Djava.net.preferIPv4Stack=trueto the end of theJVM arguments - Click ‘SAVE’
 
Set ‘-Djava.net.preferIPv4Stack=true’ in the ATLauncher
- Open the ATLauncher
 - Click on the 
Settingsbutton on the right - Click on the 
Java/Minecrafttab at the top - Add 
-Djava.net.preferIPv4Stack=trueto the end of theJVM Parameters - Click the ‘Save’ button at the bottom
 
Set ‘-Djava.net.preferIPv4Stack=true’ in the Technic Launcher
- Open the Technic Launcher
 - Click on the 
Launcher Optionsbutton at the top-right - Click on the 
Java Settingstab at the top - Add 
-Djava.net.preferIPv4Stack=trueto the end of theJava Args - Close the 
Launcher Optionswindow using the X at the top-right 
Set Java to always use ‘-Djava.net.preferIPv4Stack=true’
WARNING: This will set the option for every Java application that runs on your computer.
Windows
- Click on the 
StartMenu (Windows Icon) - Type in 
systemand click on theSystemoption that appears - On the left hand menu, click 
Advanced system settings - Click the 
Environment Variables...button - In the 
System variableslist look for_JAVA_OPTIONS - If it exists:
 
- Click on it to highlight it and then click on 
Edit - Add 
-Djava.net.preferIPv4Stack=trueto the end of the contents of theVariable value - Click 
OK 
- If it doesn’t exist:
 
- Click ‘New’
 - Enter 
_JAVA_OPTIONSintoVariable name - Enter 
-Djava.net.preferIPv4Stack=trueintoVariable value - Click 
OK 
OSX/Linux
- Open a terminal window
 - Check if the environment variable has already been set using the command:
 
echo $JAVA_OPTS
- If it is set the value will be displayed. Make a note of the value
 - Edit the startup script using the command:
 
- Linux: 
vi ~/.bash_proflle - OSX: 
vi /etc/launchd.conf 
- Press 
ito enter insert mode - Add the following text on a new line at the end of the file:
 
- Linux: 
JAVA_OPTS="-Djava.net.preferIPv4Stack=true" - OSX: 
setenv JAVA_OPTS "-Djava.net.preferIPv4Stack=true" 
- If the variable was alrady previously set:
 
- Linux: 
JAVA_OPTS="<OLD_VALUE> -Djava.net.preferIPv4Stack=true" - OSX: 
setenv JAVA_OPTS "<OLD_VALUE> -Djava.net.preferIPv4Stack=true" 
- Press 
Escto exit insert mode - Type 
:wq!and hitEnterto save your changes - The setting will take effect when you next start your machine
 
 US Multicraft
 EU Multicraft
 Aus Multicraft