Annotations
@Config
This must be attached to your config class. It defines the file name of your config, minus the extension.
@Config.Gui.Background
This may be attached to your config class. If attached, it'll set the background texture for your config.
@Config.Gui.CategoryBackground
Any number of these may be attached to your config class. If attached, it'll set the background texture for a specific category in your config.
@ConfigEntry.Category
This may be attached to a config field. If attached, it'll set the top level category of the config field. Categories are listed in the order they're first defined.
@ConfigEntry.BoundedDiscrete
This may be attached to an int
or long
config field. If attached, it'll render that config entry as a slider instead of a free number field. It takes a required max
argument, and an optional min
which defaults to 0
.
@ConfigEntry.Gui.Excluded
This may be attached to a config field. If attached, it'll exclude that field from the config gui.
@ConfigEntry.Gui.TransitiveObject
This may be attached to any Object config field. If attached, all of that inner object's fields will appear at the same level as this field.
@ConfigEntry.Gui.CollapsibleObject
This may be attached to any Object config field. If attached, all of that inner object's fields will appear in a collapsible subcategory. It takes an optional startExpanded
parameter to determine whether the subcategory is open or closed when the config screen is opened. It defaults to false
.
@ConfigEntry.Gui.Tooltip
This may be attached to any config field. If attached, it'll set a tooltip for that field. The tooltip text is defined in your lang file. It takes an optional parameter count
, which is the number of text rows in your tooltip. Default is 1
.
@ConfigEntry.Gui.PrefixText
This may be attached to any config field. If attached, it'll inject a static text entry into the gui above that field's entry in the config. The text content is defined in your lang file.
Special case: @Comment
If you attach Jankson's @Comment
annotation to a field, the String
you pass as a parameter will be applied directly as a tooltip, without lang key generation. If you're using the JanksonConfigSerializer
, the comment will also appear in the serialized config.
Last updated