Watch_me

Programming doesn’t have to be boring! Write your own Minecraft plugins and watch your code come to life with flaming cows, flying creepers, teleportation, and interactivity. Follow along with the book and add your own features to the Minecraft game by developing Java code that “plugs in” to the server. You’ll manipulate and control elements in the 3D graphical game environment without having to write tons of code or learn huge frameworks. You don’t need programming experience to get started—-this book will teach you everything you need to know!

Printed in full color.

Buy Now

Select a DRM-free Format:

In Stock
In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle, and your Dropbox. (You'll need to log in to enable these options.)
 

About this Book

  • 284 pages
  • Published:
  • Release: P1.0 (2014-05-20)
  • ISBN: 978-1-93778-578-9

Expand your Minecraft experience! You’ll learn how to write Java code and build plugins for your own Minecraft servers using the popular Java programming language and the Minecraft Bukkit library.

You’ll create plugins that can change blocks from air to stone, or spawn cows and creepers. You’ll write plugins that react to game events, and even schedule tasks that will run later in the game. Readers from age 9 to 99 will learn how to use variables and functions to build plugins that fling players into the sky, create flying creepers, and of course, shoot flaming cows.

Along the way you’ll learn real programming using Java, from classes, objects, and data structures (including arrays and hashes) to exception handling and threads. You’ll even learn how to backup your code (and go back in time!) using Git, and set up and run your own server at home or in the cloud. A running progress bar shows you how far you’ve come in each chapter, and by the end of the book you’ll be able to design and code your own plugins from scratch.

Put your gaming to good use, and learn real programming skills today.

What You Need

A modern PC running any of Windows, Mac OS X or Linux operating systems. You’ll see how to download Java, the Bukkit library, and all the tools you’ll need.

User Level

Beginners with no previous programming experience.

Contents and Extracts

  • Acknowledgments
  • Start Here
    • Who This Book Is For
    • Getting Started
    • Swimming in the Deep End
    • Getting Help
    • Conventions
  • Command Your Computer
    • Use the Command Line
    • Move around in File Directories
    • Start at the Desktop
    • Common Commands
    • Next Up
  • Add an Editor and Java
    • Install an Editor to Write Code
    • Install the Java Programming Language
    • If the Java Command Is Not Found
    • Other Reasons It Might Not Work
    • Install the Minecraft Client and Server
    • Next Up
  • Build and Install a Plugin excerpt
    • Plugin: HelloWorld
    • Configure with plugin.yml
    • Build and Install with build.sh
    • Next Up
  • Plugins Have Variables, Functions, and Keywords
    • Keep Track of Data with Variables
    • Plugin: BuildAHouse
    • Plugin: Simple
    • Organize Instructions into Functions excerpt
    • Use a for Loop to Repeat Code
    • Use an if Statement to Make Decisions
    • Compare Stuff with Boolean Conditions
    • Use a while Loop to Repeat Based on a Condition
    • Next Up
  • Plugins Have Objects
    • Everything in Minecraft Is an Object
    • Why Bother Using Objects?
    • Combine Data and Instructions into Objects
    • Plugin: PlayerStuff
    • Next Up
  • Add a Chat Command, Locations, and Targets excerpt
    • How Does Minecraft Know About Your Plugin?
    • Plugin: SkyCmd
    • Handle Chat Commands
    • Use Minecraft Coordinates
    • Find Nearby Blocks or Entities
    • Plugin: LavaVision
    • Next Up
  • Use Piles of Variables: Arrays
    • Variables and Objects Live in Blocks
    • Plugin: CakeTower
    • Use a Java Array
    • Plugin: ArrayOfBlocks
    • Use a Java ArrayList
    • Plugin: ArrayAddMoreBlocks
    • Next Up
  • Use Piles of Variables: HashMap
    • Use a Java HashMap
    • Keep Things Private or Make Them Public
    • Plugin: NamedSigns
    • Next Up
  • Modify, Spawn, and Listen in Minecraft excerpt
    • Modify Blocks
    • Plugin: Stuck
    • Modify Entities
    • Spawn Entities
    • Plugin: FlyingCreeper
    • Listen for Events
    • Plugin: BackCmd
    • Check Permissions
    • Next Up
  • Schedule Tasks for Later
    • What Happens When?
    • Put Code in a Class by Itself
    • Make a Runnable Task
    • Schedule to Run Later
    • Schedule to Keep Running
    • Plugin: CowShooter
    • Next Up
  • Use Configuration Files and Store Game Data
    • Use a Configuration File
    • Plugin: SquidBombConfig
    • Store Game Data in Local Files
    • Use PermaMap
    • Plugin: LocationSnapshot
    • Plugin: BackCmd with Save
    • PermaMap: Save and Load a Java HashMap
    • Next Up
  • Keep Your Code Safe
    • Install Git
    • Remember Changes
    • An Easy Undo
    • Visit Multiple Realities
    • Back Up to the Cloud
    • Share Code
    • Next Up
  • Design Your Own Plugin
    • Have an Idea
    • Gather Your Materials
    • Lay Them Out
    • Try Each Part
    • Knit It All Together
    • Just the Beginning
  • How to Read Error Messages
    • Java-Compiler Error Messages
    • Bukkit Server Error Messages
  • How to Read the Bukkit Documentation
    • Bukkit JavaDoc Documentation
    • Oracle JavaDoc Documentation
    • The Wiki and Tutorials
  • How to Install a Desktop Server
    • The Easy Way: LogMeIn
    • The Harder Way: By Hand
  • How to Install a Cloud Server
    • What Is the Cloud?
    • Remote Operating Systems
    • Remote Access
    • Installing Packages
    • Installing Java
    • Running Remotely
    • Domain Name
    • What’s Next
  • Cheat Sheets
    • Java Language
    • YAML Files
  • Glossary
  • Common Imports

About the Author

Andy Hunt has written and co-written over a half-dozen previous titles, including the classic The Pragmatic Programmer, Practices of an Agile Developer, and Pragmatic Thinking & Learning, and regularly speaks at conferences on software development around the world. He’s used Minecraft to help teach his son programming. When not wrangling bits, he’s an avid musician and sometimes woodworker.

Upcoming Author Events

Comments and Reviews

  • Jerry Saperstein said:

    Author Andy Hunt deserves a medal, if not a Nobel Prize, for using the Java language to get kids interested in programming. Java, frankly, strikes fear into the hearts of old men like me, but Hunt makes it palatable and accessible to kids…

  • Megan Squire said:

    The way the author describes programming concepts is authentic and correct – it’s the same stuff I would tell my first-year college students – but it’s still accessible to little kids. Kudos for this.

  • A handful of boilerplate and about five lines of custom code, and suddenly, exploding arrows! All of a sudden, doing something cool in the context of a fully realized 3D game engine is very easy. And that’s how programming has to be learned…in easy, bite-sized chunks.

    —Carl Cravens Linux system architect and Minecraft dad
  • Schneckky said:

    My 10-year-old daughter and I went through this book as a part of her homeschool curriculum. What a fantastic way to tap into a child’s obsession with Minecraft in order to educate them in programming! It wasn’t a bad lesson for me either! The instructions and explanations are crystal clear, and didn’t once leave me stumped in teaching her something I didn’t even know myself.

  • Learn to Program with Minecraft Plugins explains things very well; no programming experience required. It’s very helpful for new programmers. And so far, it’s been an excellent vehicle for some quality father-son bonding.

    —Mel Riffe (Minecraft dad) and Noah Riffe (Age 12)
  • Phenomenal. Approachable and simple, without talking down to the audience. I could see anyone at any age reading this.

    —David Bock Ruby and Rails Developer and Consultant
  • I really liked making the server plugins. My favorite was the Cow Shooter.

    —Jonathan Knowles, Age 13
  • Go you, this book is awesome!

    —Stina Qvarnström, Sweden