BukkitWiki

Welcome to the BukkitWiki!

This Wiki is home to Bukkit's documentation and regulations surrounding the Bukkit Project and it's services. Want to help out? We would love to have you! Signup to get started!

READ MORE

BukkitWiki
Advertisement

Wenn Bukkit ein Plugin lädt, dann braucht es einige grundlegende Infos über dieses. Es liest die Infos aus einer YAML-Datei aus, "plugin.yml". Diese Datei besteht aus eine Reihe von Attributen, jedes Einzelne wird in einer neuen Zeile und ohne Einrückung definiert.

Attributes
Attribut Erforderlich Beschreibung Beispiel Anmerkungen
name ja
Der Name des Plugins.
name: MyPlugin
  • Darf nur aus alphanumerischen Zeichen und Unterzeichen bestehen (a-z,A-Z,0-9, _)
  • Wird benutzt um den Namen des Plugin-Ordners festzulegen. Der Plugin-Ordner wird standardmäßig in ./plugins/* erstellt.
  • Es ist von Vorteil wenn die .jar-Datei denselben Namen wie das Plugin selbst hat, z. B. "MyPlugin.jar"
version ja Die Version des Plugins. version: 1.4.1
  • Die Version ist eine beliebige Zahlenfolge, allerdings ist das übliche Format ist "Hauptversion.Unterversion.Build" (z. B.: 1.4.1).
  • Typischerweise erhöhst Du die Version jedes Mal, wenn Du eine neue Funktion oder eine Fehlerbehebung (Bug-Fix) vorgenommen hast.
  • Wird angezeigt, wenn ein Benutzer schreibt /version PluginName
description nein Ein kurzer, aussagekräftiger Überblick, der die Funktionen des Plugins beschreibt. description: This plugin is so 31337. You can set yourself on fire.
  • Die Beschreibung kann aus mehreren Zeilen bestehen.
  • Wird angezeigt, wenn ein Benutzer schreibt /version PluginName
load nein
Ausdrückliche Angabe, wann das Plugin geladen werden soll; wenn nichts angegeben, POSTWORLD (Standard).
load: STARTUP Hat zwei mögliche Werte
  • STARTUP
  • POSTWORLD
author nein
Gibt eindeutig an, wer dieses Plugin entwickelt hat. author: CaptainInflamo
  • Anerkennen des Entwicklers.
  • Wird in manchen Fehlermeldungen angezeigt, um Ansprechpartner im Falle eines Fehlers zu ermitteln.
  • Es wird empfohlen, ein Link zum Plugin-Thread auf bukkit.org oder eine E-Mail-Adresse anzugeben.
  • Wird angezeigt, wenn ein Benutzer schreibt /version PluginName
authors nein
Wenn mehrere Entwickler mitgearbeitet haben, können diese hier gelistet werden. authors: [Cogito, verrier, EvilSeph]
  • Es können sowohl author als auch authors definiert werden, jedoch werden diese in eine Liste zusammengefügt.
website nein
Die Webseite des Plugin bzw. des Entwicklers. website: http://forums.bukkit.org/threads/MyPlugin.31337/
  • Sollte keine Webseite vorhanden sein wird empfohlen, einen Link zum Bukkit-Forumbeitrag des Plugins einzutragen.
  • Wird angezeigt, wenn ein Benutzer schreibt /version PluginName
main ja Points to the class that extends JavaPlugin main: org.bukkit.plugin.MyPlugin
  • Note that this must contain the full namespace including the class file itself.
  • If your namespace is org.bukkit.plugin, and your class file is called MyPlugin then this must be org.bukkit.plugin.MyPlugin
database no Set to true if this plugin uses a database. database: false
  • Using a database is non-trivial. See [wiki: Plugin_Databases]
depend no A list of plugins that your plugin requires to load. depend: [OnePlugin, AnotherPlugin]
  • The depend value must be in YAML list format (See http://en.wikipedia.org/wiki/YAML#Lists )
  • Use the "name" attribute of the required plugin in order to specify the dependancy.
  • If any plugin listed here is not found your plugin will fail to load.
  • (See: Wiki: Plugin_Dependencies)
softdepend no A list of plugins that are required for your plugin to have full functionality. softdepend: [OnePlugin, AnotherPlugin]
  • The depend value must be in YAML list format (See http://en.wikipedia.org/wiki/YAML#Lists )
  • Use the "name" atrribute of the desired plugin in order to specify the dependancy.
  • If the plugins listed here are found your plugin will load after they have loaded, otherwise, it will load as one of the last plugins.
  • (See: Wiki: Plugin_Dependencies)
commands no The name of a command the plugin wishes to register, as well as an optional list of command attributes.

commands:
flagrate:
 [optional command attributes]

  • The command name should not contain the leading '/' required to issue a command.
  • You can choose any command name you wish, however 'common' commands such as /kick are often already registered. Use the 'alias' command attribute to supply alternate names. @TODO: verify we're happy with this
permissions no Permissions that the plugin whishes to register. Each node represents a permission to register. Each permission can have additional attributes.
permissions:
  inferno.*:
    [optional permission attributes]
  inferno.flagate:
    [optional permission attributes]
  inferno.burningdeaths:
    [optional permission attributes]
  • Permission registration is optional, can also be done from code
  • Permission registration allows you to set descriptions, defaults, and child parent relationships
  • Permisison names should be kept in the style of <pluginname>.[category].[category].<permission>


A command block starts with the command's name, and then has a list of attributes.

Command Attribute Required Description Example Notes
description no A short description of what the command does. description: Set yourself on fire
  • Can be used in conjunction with /help
aliases no Alternate command alias/es that will be used if the command's name is already taken
aliases: combust_me OR 
aliases: [combust_me, combustMe]
permission no The most basic permission node required to use the command
permission: inferno.flagrate
  • This permissions node can be used to determine if a user should be able to see this command
  • Some plugins will use this node to construct a personalised /help
usage no A short description of how to use this command. usage: Syntax error! Perhaps you meant /<command> PlayerName?
  • Displayed to whoever issued the command when the plugin's command handler (onCommand typically) does not return true.
  • <command> is a macro that is replaced with the command issued wherever it occurs.
  • To use the string "Usage:" (i.e. usage: Usage: /god [player], surround the text after the usage: label with double-quotes:
    usage: "Usage: /god [player]"


A permission block starts with the permission's name and is followed by nodes of attributes

Permission Attribute Required Description Example Notes
description no A short description of what this permission allows
description: Allows you to set yourself on fire
  • Allows programmatic access, and helps server administrators
default no Sets the default value of the permission
default: true
  • If node does not exist the permission defaults to false
  • allowed defualts are: true, false, op, not op
  • op default will be true if player is op
  • no op default is the opposite behavior (of op)

children no allows you to set children for the permission. Child nodes are permission names
children:
  inferno.flagrate: true
  inferno.burningdeaths: true
  • Each child node must be either set to true or false
    • a child node of true inherits the parent permission
    • a child node of false inherits the inverse parent permission
  • Can also contain other permission nodes {1}


Example:

name: Inferno
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] 
website: http://forums.bukkit.org/threads/MyPlugin.31337/

main: com.captaininflamo.bukkit.inferno.Inferno
database: false
depend: [NewFire, FlameWire]

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


Language   EnglishбеларускаяDeutschespañolsuomifrançaisitaliano한국어Nederlandsnorskpolskiportuguêsрусскийlietuviųčeština
Advertisement