Annotation Interface CraftTweakerPlugin


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface CraftTweakerPlugin
Marks the class as a CraftTweaker plugin, which needs to be detected and loaded by CraftTweaker.

Classes annotated by this annotation will be automatically discovered and class-loaded when required by CraftTweaker: no additional registration is necessary for the consumer of the API.

Classes annotated with this annotation must implement the ICraftTweakerPlugin interface and have a single parameter-less public constructor. If any of these conditions are not followed, the plugin will not be loaded and a runtime error will occur.

Refer to the methods available in ICraftTweakerPlugin for more information on what actions are exposed to plugins.

Since:
9.1.0
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the ID of the plugin.
  • Element Details

    • value

      String value
      Returns the ID of the plugin.

      The ID must be unique among plugins, as it is used to identify each plugin during the various initialization procedures of CraftTweaker.

      It is mandatory for the plugin's ID to be a valid resource location, i.e. it must follow the form "mod:name". It is illegal for a plugin to omit the namespace or to specify minecraft as its namespace.

      Returns:
      The ID of the plugin.
      Since:
      9.1.0