Annotation Interface ConfigTitle


@Retention(RUNTIME) @Target(FIELD) public @interface ConfigTitle
Annotation that defines a title/heading within the configuration panel.

Titles are used to create visual separation and organization within sections. They display as headers that group related configuration items without the collapsible behavior of sections.

To define a title, annotate a String field in your Config interface:


 @ConfigGroup("myplugin")
 public interface MyConfig extends Config {
     @ConfigSection(
         name = "Settings",
         description = "Plugin settings",
         position = 1
     )
     String settingsSection = "Settings";

     @ConfigTitle(
         name = "Combat Options",
         description = "Options related to combat",
         position = 1,
         section = "Settings"
     )
     String combatTitle = "Combat";

     @ConfigItem(
         keyName = "autoRetaliate",
         name = "Auto Retaliate",
         description = "Automatically fight back",
         section = "Settings",
         title = "Combat"  // References the title
     )
     default boolean autoRetaliate() {
         return true;
     }
 }
 

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    A description of what this title group contains.
    The display name of the title.
    int
    The display position of this title within its section.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether this title should be hidden from the UI.
    The key name for this title.
    The section this title belongs to.
    The parent title this title belongs to.
    The key name of a config item that controls this title's visibility.
  • Element Details

    • name

      String name
      The display name of the title.
      Returns:
      the title text shown in the UI
    • description

      String description
      A description of what this title group contains.

      Displayed as a tooltip when hovering over the title.

      Returns:
      the title description
    • position

      int position
      The display position of this title within its section.

      Titles and items are sorted by position in ascending order.

      Returns:
      the position value
    • title

      String title
      The parent title this title belongs to.

      Allows creating nested title hierarchies.

      Returns:
      the parent title field name, or empty string for top-level
      Default:
      ""
    • keyName

      String keyName
      The key name for this title.

      If not specified, uses the field name as the key.

      Returns:
      the key name, or empty string to use field name
      Default:
      ""
    • section

      String section
      The section this title belongs to.

      Specify the section field name defined with ConfigSection.

      Returns:
      the section field name, or empty string for no section
      Default:
      ""
    • hidden

      boolean hidden
      Whether this title should be hidden from the UI.
      Returns:
      true if hidden, false otherwise (default)
      Default:
      false
    • unhide

      String unhide
      The key name of a config item that controls this title's visibility.

      When the specified item's value is truthy, this title becomes visible.

      Returns:
      the controlling item's key name, or empty string
      Default:
      ""