Skip to content

Name & Lore Operations ​

CoreLib's two configuration sections, name_actions and lore_actions, change an item's name and lore line by line

CoreLib provides one unified way to edit item names and lore. All Emaki plugins use name_actions and lore_actions to control the name and description display precisely

The operation system is stateless — every render walks the full operation chain from scratch. When state changes (e.g., enhancement rollback), the system re-runs the chain with the new variable values and the display comes out correct


Name Operations (name_actions) ​

Make precise changes to the item name. Operations run in the order you write them in the configuration

replace ​

Replace the whole item name, clearing all previous prefixes and suffixes

yaml
name_actions:
  - action: "replace"
    value: "<gold>%quality_name% Flame Sword</gold>"

prepend_prefix ​

Add a prefix before the name

yaml
name_actions:
  - action: "prepend_prefix"
    value: "<red>[+%star%] </red>"

append_suffix ​

Add a suffix after the name

yaml
name_actions:
  - action: "append_suffix"
    value: " <gray>[%quality_name%]</gray>"

regex_replace ​

Perform regex replacement on the name. Only effective after the name has been set via replace

yaml
name_actions:
  - action: "regex_replace"
    regex_pattern: "\\[\\+\\d+\\]"
    replacement: "[+%star%]"

Lore Operations (lore_actions) ​

Execute precise modifications on item lore. Operations execute in configuration order

append ​

Add content after the last lore line

yaml
lore_actions:
  - action: "append"
    content:
      - ""
      - "<gray>Enhancement: <gold>+%star%</gold></gray>"

prepend ​

Add content before the first lore line

yaml
lore_actions:
  - action: "prepend"
    content:
      - "<gradient:#F2C46D:#C9703D>Enhancement +%star%</gradient>"
      - ""

insert_below ​

Insert content below the matching line. Aliases: search_insert_below, search_insert

yaml
lore_actions:
  - action: "insert_below"
    anchor: "Physical Damage"
    content:
      - "<gray>Enhancement bonus: <gold>+%physical_attack%</gold></gray>"

insert_above ​

Insert content above the matching line. Alias: search_insert_above

yaml
lore_actions:
  - action: "insert_above"
    anchor: "Quality"
    content:
      - ""
      - "<yellow>Enhancement Effects:</yellow>"

replace_line ​

Replace the first matching line

yaml
lore_actions:
  - action: "replace_line"
    anchor: "Enhancement Level"
    content:
      - "<gradient:#F2C46D:#C9703D>Enhancement +%star%</gradient>"

replace_text ​

Replace a text fragment inside a matching line instead of the whole line. Only one line is processed by default; index selects which matching line to use, falling back to the last match when out of range

yaml
lore_actions:
  - action: "replace_text"
    anchor: "old text"
    replacement: "new text"

replace_text_all ​

Same as replace_text, but replaces every occurrence in every matching line

yaml
lore_actions:
  - action: "replace_text_all"
    anchor: "old text"
    replacement: "new text"

delete_line ​

Delete all matching lines

yaml
lore_actions:
  - action: "delete_line"
    anchor: "Old enhancement info"

regex_replace ​

Perform regex replacement on all lore lines

yaml
lore_actions:
  - action: "regex_replace"
    regex_pattern: "\\+\\d+"
    replacement: "+%star%"

Match Fields ​

The match text in insert_below, insert_above, replace_line, and delete_line operations supports multiple field names (by priority):

FieldPriorityDescription
target_patternHighestMatch target text
patternMediumMatch target text
anchorLowestMatch target text

Matching uses contains matching, not exact matching


Variable Substitution ​

All value, content, anchor, and replacement fields support %variable_name% format variable substitution. Variable name lookup is case-insensitive. If PlaceholderAPI is installed, the rendered text is additionally resolved through PAPI

Available variables depend on the plugin using the operations:

PluginAvailable Variables
EmakiStrengthen%star%, %temper%, %max_temper%, %temper_color%, and all variables values
EmakiForge%quality%, %quality_name%, %multiplier%, %player_name%, %player_uuid%, and all forge attribute values
EmakiGem%slot_index%, %slot_type%, %gem_name%, %gem_level%

Rollback Mechanism ​

The operation system is stateless. Each render executes the full operation chain from scratch

When enhancement rolls back (e.g., +10 fails back to +9):

  1. System recalculates variables with the rolled-back star level (%star%=9, attribute values decrease accordingly)
  2. Re-executes the entire name_actions and lore_actions operation chain
  3. Automatically produces the correct +9 display

No "undo" operation is needed — re-execution produces the correct result. This is the core design advantage of the operation system


Full Configuration Examples ​

EmakiStrengthen Recipe ​

yaml
name_actions:
  - action: "append_suffix"
    value: " <yellow>[+%star%]</yellow>"

lore_actions:
  - action: "append"
    content:
      - ""
      - "<gradient:#F2C46D:#C9703D>Enhancement +%star%</gradient>"
      - "<gray>Temper: %temper_color%%temper%/%max_temper%</gray>"
  - action: "insert_below"
    anchor: "Physical Damage"
    content:
      - "<gray>  Enhancement bonus: <gold>+%physical_attack%</gold></gray>"

EmakiForge Recipe ​

yaml
name_actions:
  - action: "prepend_prefix"
    value: "<light_purple>[%quality_name%]</light_purple> "

lore_actions:
  - action: "append"
    content:
      - ""
      - "<gray>Forge Quality: <white>%quality_name%</white></gray>"
      - "<gray>Quality Multiplier: <white>x%multiplier%</white></gray>"
      - "<gray>Forged by: <white>%player_name%</white></gray>"