Annotation Interface Plugin


@Retention(RUNTIME) @Target(TYPE) public @interface Plugin
Marks a org.bukkit.plugin.java.JavaPlugin subclass or net.md_5.bungee.api.plugin.Plugin subclass as an plugin.

To define your main class as an plugin simply annotate the class with:

@Plugin(name = "PluginName", version = "1.0.0-SNAPSHOT")

Each attribute in this annotation is mapped to an key in tha yaml file.

Because this annotation can be applied to Spigot and BungeeCord plugins there are the extension named spigot() and bungee(). To apply specific values for eg. a Spigot plugin.

To use these apply it like that:

@Plugin(name = "PluginName", version = "1.0.0-SNAPSHOT", spigot = @Spigot(website = "http://foo.bar"))

The class annotated with @Plugin is automatically used as main-class for the yaml file. You can also use public static nested classes or a class that is in any way a child of org.bukkit.plugin.java.JavaPlugin or net.md_5.bungee.api.plugin.Plugin.

If you code a plugin that is usable in Spigot and BungeeCord simply annotate both main classes with @Plugin.
See Also:
  • Element Details

    • name

      String name
      The name of the plugin.
      Returns:
      The name of the plugin
    • version

      String version
      The version of the plugin.
      Returns:
      The version of the plugin
      Default:
      ""
    • description

      String description
      The description of the plugin.
      Returns:
      The description of the plugin
      Default:
      ""
    • dependencies

      Dependency[] dependencies
      The dependencies of the plugin.
      Returns:
      The dependencies of the plugin
      See Also:
      Default:
      {}
    • spigot

      Spigot specific settings.
      Returns:
      The specific settings
      Default:
      @eu.hexagonmc.spigot.annotation.plugin.Plugin.Spigot(set=false)
    • bungee

      BungeeCord specific settings.
      Returns:
      The specific settings
      Default:
      @eu.hexagonmc.spigot.annotation.plugin.Plugin.Bungee(set=false)