Configure with Canary.inf

This source code alone isn’t enough; you also need a configuration file so that Minecraft can find and launch your plugin. The configuration file is named Canary.inf and looks like this:

HelloWorld/Canary.inf
 
main-class = helloworld.HelloWorld
 
name = HelloWorld
 
author = AndyHunt, Learn to Program with Minecraft Plugins
 
version = 1.0

Here’s a description of what this file needs. Don’t worry much about the details yet—it will make more sense as we get further into the book.

main-class

Name of the package and class that Java will run to start this plugin (package.classname).

name

Name of the plugin—in this case, HelloWorld.

author

Name of the author (that’s you).

version

Version number of your plugin. Start low, ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.