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

Introduction to Spigot


As you set up your own server and begin to create plugins, you will encounter a few terms that may be new to you. The terms are Vanilla, Bukkit, CraftBukkit, and Spigot.

Vanilla refers to the normal Minecraft game developed by Mojang/Microsoft. The Vanilla Server is the official version of the game. It can be downloaded from minecraft.net and is typically named minecraft_server.jar or minecraft_server.exe. The vanilla server currently does not support any sort of mods or plugins. This is where Bukkit comes in.

Bukkit is an API that helps us to develop plugins. We will discuss this in detail in Chapter 2, Learning the Bukkit API. Until then, it is sufficient to know that when you hear the phrase bukkit plugins, it is referring to the plugins that are built against the Bukkit API.

The Bukkit API was originally developed by the CraftBukkit team. This brings us to the next term. CraftBukkit is a modified Minecraft server that replaces the vanilla server. CraftBukkit and vanilla Minecraft provide us with essentially the same game. The difference is that CraftBukkit has the ability to load Bukkit plugins and execute the code within the game. CraftBukkit translates the Bukkit methods and variables into Minecraft code, which was developed by Mojang. CraftBukkit also includes additional code to aid plugin developers with completing certain tasks, such as saving/loading data, listening for server events, and scheduling the code that needs to be executed. We will not mention CraftBukkit much in this book, because it has been replaced with a project named Spigot.

Spigot completely replaces the vanilla Minecraft server, just as CraftBukkit does. Spigot was built on top of the CraftBukkit project. Therefore, they share a lot of the same code. However, Spigot is more configurable via its settings; in many ways, it is much faster. The Spigot team now maintains all three of the projects, namely Bukkit, CraftBukkit, and Spigot. You will be able to use either CraftBukkit or Spigot to run a server, since the Spigot team has been kind enough to provide us with both. I recommend running the Spigot server for the reasons mentioned earlier.