Book Image

Building Minecraft Server Modifications - Second Edition

By : Cody M. Sommer
4 (1)
Book Image

Building Minecraft Server Modifications - Second Edition

4 (1)
By: Cody M. Sommer

Overview of this book

Minecraft is a sandbox game that allows you to play it in any way you want. Coupled with a multiplayer server powered by Spigot, you can customize the game even more! Using the Bukkit API, anyone interested in learning how to program can control their Minecraft world by developing server plugins. This book is a great introduction to software development through the wonderful world of Minecraft. We start by instructing you through how to set up your home PC for Minecraft server development. This includes an IDE complete with the required libraries as well as a Spigot server to test on. You will be guided through writing code for several different plugins. Each chapter teaches you new skills to create plugins of increasing complexity, and each plugin adds a new concept of the Bukkit API By the end of the book, you will have all the knowledge you need about the API to successfully create any type of plugin. You can then practice and build your Java skills through developing more mods for their server.
Table of Contents (17 chapters)
Building Minecraft Server Modifications Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a new project


Once it is installed, open NetBeans to begin the creation of the first project. You can create a new project by performing the following steps:

  1. Open the File menu and click on New Project....

  2. We want to create a new java application. Java Application is already selected by default. Therefore, simply click on Next.

  3. We must now name the first project. It is a good idea to avoid using spaces in a name. Let's name this project MyFirstBukkitPlugin.

  4. Unless you want to store your project in another location, you can leave the default value of Project Location.

  5. Ensure that Create Main Class is checked.

The main class is where we will put the code that is needed to enable the plugin that we want to create. For this field, you must determine the package of your project. This usually involves your website's domain name in the reverse order. For example, Bukkit uses org.bukkit and I use com.codisimus. Assuming that you don't have your own domain name, you can use your e-mail address...