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
| Field | Type | Default | Description |
|---|---|---|---|
id | string | — | Format id referenced by lore_format_id in attribute definitions. A file without it is not loaded. |
format | string | %sign%%value% %name% | Display template. |
precision | integer | 2 | Decimal precision. |
read_priority | integer | see below | Higher priority patterns are tried first. |
read_patterns | list | [] | 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
| Variable | Description |
|---|---|
%name% | Attribute display name. |
%sign% | + or -. |
%value% | Formatted attribute value. |
Built-in formats
| File | ID | format | precision | read_priority | Use case |
|---|---|---|---|---|---|
default_percent.yml | default_percent | %name% %sign%%value%% | 2 | 100 | Percent attributes. |
default_regen.yml | default_regen | %name% %sign%%value%/秒 | 1 | 80 | Regeneration attributes. |
default_resource.yml | default_resource | %name% %sign%%value% | 2 | 60 | Resource attributes. |
default_flat.yml | default_flat | %name% %sign%%value% | 2 | 50 | Flat 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