Skip to content

Lore Formats

Lore format files are stored in lore_formats/*.yml. They define how attributes are rendered in item lore and how existing lore lines can be parsed back into attribute values.

Fields

FieldTypeDefaultDescription
idstringFormat id referenced by lore_format_id in attribute definitions. A file without it is not loaded.
formatstring%sign%%value% %name%Display template.
precisioninteger2Decimal precision.
read_priorityintegersee belowHigher priority patterns are tried first.
read_patternslist[]Patterns used to parse values from lore.

read_patterns also accepts aliases: read_pattern, lore_patterns, and lore_pattern.

When read_priority is omitted, the four built-in format ids fall back to their own defaults (default_percent 100, default_regen 80, default_resource 60, default_flat 50); any other id defaults to 0.

Template variables

VariableDescription
%name%Attribute display name.
%sign%+ or -.
%value%Formatted attribute value.

Built-in formats

FileIDformatprecisionread_priorityUse case
default_percent.ymldefault_percent%name% %sign%%value%%2100Percent attributes.
default_regen.ymldefault_regen%name% %sign%%value%/秒180Regeneration attributes.
default_resource.ymldefault_resource%name% %sign%%value%260Resource attributes.
default_flat.ymldefault_flat%name% %sign%%value%250Flat numeric attributes.

The bundled read_patterns use the %Key% / %Value% template variables rather than raw regex, for example default_flat uses "%Key%.*?: ?%Value%$". %Value% accepts both single values and ranges such as 1-5 or 1~5.

Example

yaml
id: custom_percent
format: "%name%: %sign%%value%%"
precision: 1
read_patterns:
  - '%Key%.*?: ?%Value%%$'

Reference it from an attribute definition:

yaml
id: physical_attack
display_name: "Physical Attack"
lore_format_id: default_flat