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. |
format | string | %sign%%value% %name% | Display template. |
precision | integer | 2 | Decimal precision. |
read_priority | integer | 0 | Higher priority patterns are tried first. |
read_patterns | list | [] | Regex patterns used to parse values from lore. |
read_patterns also accepts aliases: read_pattern, lore_patterns, and lore_pattern.
Template variables
| Variable | Description |
|---|---|
%name% | Attribute display name. |
%sign% | + or -. |
%value% | Formatted attribute value. |
Built-in formats
| File | ID | Use case |
|---|---|---|
default_flat.yml | default_flat | Flat numeric attributes. |
default_percent.yml | default_percent | Percent attributes. |
default_regen.yml | default_regen | Regeneration attributes. |
default_resource.yml | default_resource | Resource attributes. |
Example
yaml
id: custom_percent
format: "%name%: %sign%%value%%"
precision: 1
read_patterns:
- '(.+): ([+-]?\d+\.?\d*)%'Reference it from an attribute definition:
yaml
id: physical_attack
display_name: "Physical Attack"
lore_format_id: default_flat