PacktLib: Building Minecraft Server Modifications

Building Minecraft Server Modifications

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Deploying a CraftBukkit Server

Installation

Setup

Minecraft/Bukkit server commands

Port forwarding

Summary

Learning the Bukkit API

Introduction to APIs

The Bukkit API documentation

Navigating the Bukkit API documentation

Understanding the Java documentation

Exploring Bukkit API

Summary

Creating Your First Bukkit Plugin

Installing an IDE

Creating a new project

Adding Bukkit as a library

The essentials of a Bukkit plugin

Making and calling new methods

Expanding your code

Summary

Testing on the CraftBukkit Server

Building the JAR file

Installing your plugin

Testing your plugin

Testing new versions of your plugin

Summary

Plugin Commands

Adding a command to plugin.yml

Programming the command actions

Assigning the executor for the command

Summary

Player Permissions

The benefits of permissions

Understanding permission nodes

Adding a permission node to plugin.yml

Assigning a permission node to a plugin command

Testing player permissions

Using a third-party permissions plugin

Using permission nodes throughout your plugins

Summary

The Bukkit Event System

Choosing an event

Registering an event listener

Listening for an event

Canceling an event

Communicating among events

Modifying an event as it occurs

Creating more plugins on your own

Summary

Making Your Plugin Configurable

Configurable data types

Writing a config.yml file

Saving, loading, and reloading the config file

Reading and storing the configured values

Using configured settings within your plugin

ItemStack within a configuration

YAML configuration hierarchy

Storing configuration values as variables

Accessing variables from another class

Summary

Saving Your Data

Types of data that can be saved

Which data to save and when

A sample teleportation plugin

Writing a ConfigurationSerializable class

Saving data to a YAML configuration

Loading data from a YAML configuration

Summary

The Bukkit Scheduler

Creating a BukkitRunnable class

Synchronous versus asynchronous tasks

Running a task from a BukkitRunnable class

Running a task later from a BukkitRunnable

Running a task timer from a BukkitRunnable class

Writing a repeating task for a plugin

Adding a delayed task to a plugin

Executing a code asynchronously

Summary

Index