Class PluginDescriptionFile

java.lang.Object
org.bukkit.plugin.PluginDescriptionFile

public final class PluginDescriptionFile extends Object
This type is the runtime-container for the information in the plugin.yml. All plugins must have a respective plugin.yml. For plugins written in java using the standard plugin loader, this file must be in the root of the jar file.

When Bukkit loads a plugin, it needs to know some basic information about it. It reads this information from a YAML file, 'plugin.yml'. This file consists of a set of attributes, each defined on a new line and with no indentation.

Every (almost* every) method corresponds with a specific entry in the plugin.yml. These are the required entries for every plugin.yml:

Failing to include any of these items will throw an exception and cause the server to ignore your plugin.

This is a list of the possible yaml keys, with specific details included in the respective method documentations:

The description of the plugin.yml layout
Node Method Summary
name getName() The unique name of plugin
provides getProvides() The plugin APIs which this plugin provides
version getVersion() A plugin revision identifier
main getMain() The plugin's initial class file
author
authors
getAuthors() The plugin authors
contributors getContributors() The plugin contributors
description getDescription() Human readable plugin summary
website getWebsite() The URL to the plugin's site
prefix getPrefix() The token to prefix plugin log entries
load getLoad() The phase of server-startup this plugin will load during
depend getDepend() Other required plugins
softdepend getSoftDepend() Other plugins that add functionality
loadbefore getLoadBefore() The inverse softdepend
commands getCommands() The commands the plugin will register
permissions getPermissions() The permissions the plugin will register
default-permission getPermissionDefault() The default default permission state for defined permissions the plugin will register
awareness getAwareness() The concepts that the plugin acknowledges
api-version getAPIVersion() The API version which this plugin was programmed against
libraries () The libraries to be linked with this plugin

A plugin.yml example:

name: Inferno
provides: [Hell]
version: 1.4.1
description: This plugin is so 31337. You can set yourself on fire.
# We could place every author in the authors list, but chose not to for illustrative purposes
# Also, having an author distinguishes that person as the project lead, and ensures their
# name is displayed first
author: CaptainInflamo
authors: [Cogito, verrier, EvilSeph]
contributors: [Choco, md_5]
website: http://www.curse.com/server-mods/minecraft/myplugin

main: com.captaininflamo.bukkit.inferno.Inferno
depend: [NewFire, FlameWire]
api-version: 1.13
libraries:
    - com.squareup.okhttp3:okhttp:4.9.0

commands:
  flagrate:
    description: Set yourself on fire.
    aliases: [combust_me, combustMe]
    permission: inferno.flagrate
    usage: Syntax error! Simply type /<command> to ignite yourself.
  burningdeaths:
    description: List how many times you have died by fire.
    aliases: [burning_deaths, burningDeaths]
    permission: inferno.burningdeaths
    usage: |
      /<command> [player]
      Example: /<command> - see how many times you have burned to death
      Example: /<command> CaptainIce - see how many times CaptainIce has burned to death

permissions:
  inferno.*:
    description: Gives access to all Inferno commands
    children:
      inferno.flagrate: true
      inferno.burningdeaths: true
      inferno.burningdeaths.others: true
  inferno.flagrate:
    description: Allows you to ignite yourself
    default: true
  inferno.burningdeaths:
    description: Allows you to see how many times you have burned to death
    default: true
  inferno.burningdeaths.others:
    description: Allows you to see how many times others have burned to death
    default: op
    children:
      inferno.burningdeaths: true