Building Minecraft Server Modifications - Second Edition
eBook - ePub

Building Minecraft Server Modifications - Second Edition

  1. 158 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Building Minecraft Server Modifications - Second Edition

Book details
Book preview
Table of contents
Citations

About This Book

Create and customize your very own Minecraft server using Java and the Spigot API

About This Book

  • Set up a Minecraft server that you control
  • Use object-oriented programming to modify Minecraft regardless of your level of experience
  • This interactive guide will help you create a unique experience for you and your friends

Who This Book Is For

This book is great for anyone who is interested in customizing their Minecraft server. Whether you are new to programming, Java, Bukkit, or even Minecraft itself, this book has you covered. All you need is a valid Minecraft account. If you are interested in programming as a career or hobby, this book will get you started. If you are simply interested in playing Minecraft with your friends, then this book will help you make that experience even more enjoyable.

What You Will Learn

  • Install and run a Spigot server for free on your home PC
  • Adjust the server settings to customize Minecraft to your liking
  • Install an IDE and configure a project to write code
  • Install and test plugins on a Spigot server
  • Test your plugins through debugging the code
  • Program in game commands and permissions
  • Get to know advanced programming concepts such as event-driven programming, configuration files, saving/loading data, and scheduled tasks
  • Implement configuration files to make your plugins customizable
  • Save and load your plugin's data to persist across server restarts

In Detail

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.

Style and approach

This hands-on guide is filled with interactive examples to help you modify Minecraft. Programming terms and concepts are explained along the way so even those who have never written code before can keep up.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Building Minecraft Server Modifications - Second Edition by Cody M. Sommer in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785883026
Edition
2

Building Minecraft Server Modifications Second Edition


Table of Contents

Building Minecraft Server Modifications Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Deploying a Spigot Server
Introduction to Spigot
Installing a new Spigot server
Setting up a new server
Minecraft/Bukkit server commands
Port forwarding
Summary
2. Learning the Bukkit API
Introduction to APIs
The Bukkit API documentation
Navigating through the Bukkit API documentation
Understanding the Java documentation
Exploring the Bukkit API
Summary
3. Creating Your First Bukkit Plugin
Installing an IDE
Creating a new project
Adding Bukkit as a library
The essentials of a Bukkit plugin
The plugin.yml file
The plugin's main class
Making and calling new methods
Expanding your code
Summary
4. Testing on the Spigot Server
Building a JAR file
Installing the plugin
Testing your plugin
Testing new versions of the plugin
Debugging the code
Learning from your mistakes
When researching is not enough
Reading the stack trace
Breaking down the code
Adding debug messages
Referring back to the Javadoc
Fixing the bug only after you understand it
Summary
5. Plugin Commands
Adding a command to plugin.yml
Programming the command actions
Assigning the executor for the enchant command
Summary
6. 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
7. 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
8. 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
9. 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
10. 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 class
Running a task timer from a BukkitRunnable class
Writing a repeating task for a plugin
Adding a delayed task to a plugin
Executing code asynchronously
Summary
Index

Building Minecraft Server Modifications Second Edition

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2013
Second edition: December 2015
Production reference: 1151215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-302-6
www.packtpub.com
Cover Image by Cody M. Sommer

Credits

Author
Cody M. Sommer
Reviewers
Thomas E. Enebo
Pat Patterson
Commissioning Editor
Veena Pagare
Acquisition Editor
Vinay Argekar
Content Development Editor
Divij Kotian
Technical Editor
Mohit Hassija
Copy Editor
Vedangi Narvekar
Project Coordinator
Neha Bhatnagar
Proofreader
Safis Editing
Indexer
Priya Sane
Graphics
Kirk D'Penha
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade

About the Author

Cody M. Sommer graduated from SUNY Brockport with a bachelor's degree in computer science. During his time in college, he practiced his Java techniques by writing code for Bukkit plugins. The Bukkit project provided Cody with a fun way to develop software and continue to learn new things. After a few years, Cody authored the first edition of Building Minecraft Server Modifications in order to share his knowledge with the world. To this day, he creates new and exciting plugins for Minecraft servers. Cody has developed public plugins that are available for download, such as PhatLoots. He is also a private developer for servers such as ProspectMC. He even makes custom plugins for Minecraft events, which are hosted by him at his local library.

About the Reviewers

Thomas E. Enebo is the co-leader of the JRuby project and author of the Minecraft plugin project, Purugin. He has been a practioner of Java since the heady days of the HotJava browser, and he has happily been using Ruby since 2001. Thomas has spoken at many Java and Ruby conferences, co-authored Using JRuby, and won the Ruby Hero award. He was awarded the "Rock Star" award at JavaOne. When Thomas is not coding, he enjoys jogging, reading, and drinking a nice India pale ale (IPA).
Pat Patterson has been working with Internet technologies since 1997. He has built software and worked with developer communities at Sun Microsystems, Huawei Technologies, and Salesforce. At Sun, Pat was best known as the community lead for the Op...

Table of contents

  1. Building Minecraft Server Modifications Second Edition