Minecraft is the ultimate sandbox auto-generated open-world awesomefest. It's packed with stuff to do, and yet demands nothing from the player (except to not die in survival mode). There are no quests. There are no rules. You literally are dropped in a world with nothing and you must figure everything out on your own (or look it up on the wiki).
There are plenty of tutorials online that show you how to set up a Minecraft Server on the Mac, but I could not find one that starts from initial setup of the server to making it available to the world. So that's what this is all about.
Starting the Server
This is the easy bit, but it's important to at least know the terminal command to start up the server.
- Check your installation of Java. It should be installed automatically by Apple Updates, but to check, open up a Terminal window (Terminal is in Applications->Utilities) and type 'java -version' (without quotes). If it is installed, it will show you the version info. If not, use Apple Update to update your Mac or download it online if possible.
- Go to http://minecraft.net/download and download the server (minecraft_server.jar).
- Find a location on your machine to store the server (e.g. ~/Desktop) and create a folder there called 'Minecraft Server' or whatever. Move the minecraft_server.jar into the newly created folder.
- To start the server, go to a Terminal window and navigate to its location (a la ~/Desktop/Minecraft\ Server), and type the following command: 'java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui'. To give you an idea of what that does, it's executing the java command which executes the minecraft_server.jar. The -Xmx1024M and -Xms1024M are allocating memory to be used by the server (it's not dynamic), the -jar signifies that it's a jar file, and the nogui is an input to the server saying you'll just use the terminal for log info, thank you very much.
Publishing the Server
This part can be tricky because all routers are different. Regardless, I hope this will provide a little more insight than what you'll find elsewhere on the net.
Setting up the router
- Go to your router settings. Typically to do this, open a web browser and go to 192.168.1.1. If you're setup to use WPA/WPA2 (password protected), you'll need to give your login credentials.
- Once in the router settings, there should be a section called 'Port Forwarding'. In mine, it's in the supersection 'Applications and Gaming' and it's partitioned by Single and Range- Port Forwarding. In this case, we can use a single port.
- In this section, add an entry for Minecraft at External and Internal Port 25565 (the default for minecraft server) with an 'Either' or 'Both' for the network protocol. Assign a local IP address such as 192.168.1.11 in the entry. In mine, you need to check the 'Enabled' checkbox. Save the settings.
Setting up the machine's NICGo to System Preferences->Network. Click on the Advanced button. In the TCP/IP section, switch the 'Configure IPv4' to 'Manually'. Now set the IPv4 Address to the address we provided earlier (e.g. 192.168.1.11). Make sure to click Ok and then Apply.
At this point, you'll need to restart the server, and you should be done! I ran into one issue which will I'll address in the section below.
IssuesOne issue I ran into was that whenever folks tried to join the server, they would get an error:
To fix this, open up the 'server.properties' file that was created in the server folder. Set the online mode to 'false' (online-mode=false).