Book Image

Building Minecraft Server Modifications

By : Cody M. Sommer
Book Image

Building Minecraft Server Modifications

By: Cody M. Sommer

Overview of this book

If you have ever played Minecraft on a public server then the chances are that the server was powered by Bukkit. Bukkit plugins allow a server to be modified in more ways than you can imagine. Learning to program your own server mods will allow you to customize the game to your own liking. Building Minecraft Server Modifications is a complete guide that walks you through the creation of Minecraft server mods. From setting up a server, to testing your newly made plugins, this book teaches you everything you need to know. With the help of this book you can start practising for a career in software development or simply create something awesome to play with your friends. This book walks you through installing your own Minecraft server for you and your friends. Once your server is running, it will aid you in modifying the game by programming Bukkit plugins. You will learn how to program simple plugin features such as player commands and permissions. You will also learn more complex features including listening for events, creating a configurable plugin, and utilizing the Bukkit scheduler. All of this will be accomplished while writing your own server mods. You will become familiar with the most important aspects of the Bukkit API. Additional API features will become a breeze to learn after tackling these more complicated tasks.
Table of Contents (17 chapters)
Building Minecraft Server Modifications
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Port forwarding


Where's the fun in running your own Minecraft server when no one else can log into it? I will now explain how to allow your friends to connect to your server so that they can play with you. In order to do this, we must first find your IP address. Much like your place of residence has a street address, your computer has an address on the Internet. This is what your friends will type into their Minecraft client to find your server. To find this, simply search IP on Google. At the top of the results will be a line that states: Your public IP address is XX.XX.XXX.XX (the Xs will be replaced with numbers and its overall length may be different). You can also visit www.whatismyip.com to find your IP address.

Once you have your IP address, try using it to connect to your server rather than using localhost. If you are able to connect, then your friends will be able to, too. If not, you will have to take additional steps to allow other players to connect to your server. This will be the case if your computer is attached to a router. We must let the router know to point other Minecraft players towards your computer that is running the server. This process is called port forwarding and to do so, we will first need some additional information.

We need to know the IP address of your computer on your local network. This IP will be different from the address we obtained earlier. We will also need to know the IP of your router. To find these, we will open up a new command prompt window. The command prompt can be found at:

Start Menu/All Programs/Accessories/Command Prompt

You can also search cmd.exe to find it. Once the command prompt is open, type:

# ipconfig

Then, press Enter. A screen will be displayed similar to the one in the following screenshot:

In the previous image I have highlighted the two IP addresses that you are looking for. The numbers will most likely be very similar to these sample numbers. IPv4 Address is the address of your computer, and Default Gateway is the address of your router. Take note of both of these IPs.

Next, we will log into your router. In any web browser, type the IP address of the router (192.168.1.100 in our example). If you did this correctly, then you will be prompted with a login form asking for a username and password. If you do not know this information, you can try admin for both. If that is unsuccessful, you will have to find the default username and password, which can be found in the paperwork that was provided with your router. This information can usually be found online as well, by searching the name of your router along with the terms default login.

Once we are logged into the router, we must find the area that includes the settings for port forwarding. There exist many brands and models of routers in the world and all of them present this option differently, so I cannot provide a specific walkthrough of how this page is found. However, you will want to look for a tab that says something along the lines: Forwarding, Port Forward, or Applications & Gaming. If you do not see any of these, then expand your search by exploring the advanced settings. Once you find the correct page, you will most likely see a table that looks like the following one:

Application Name

External Port

Internal Port

Protocol

IP Address

Bukkit Server

25565

25565

TCP and UDP

192.168.1.100

Fill in the fields as it is shown in the previous table. Of course, the layout and formatting will differ depending on your router, but the important details are that you forward port 25565 to the IP address that you found earlier (192.168.1.100 in our example). Be sure to save these new settings. If you have done this correctly, then you should now be able to connect to your server using your public IP address.