Skip to content

Assembly and Structured Presentation

Assembly rebuilds final item display from structured module layers. This prevents modules from overwriting each other's lore.

Common layers

NamespaceOrderMeaning
forge100Forge layer.
strengthen200Strengthening layer.
gem300Gem layer.
cooking10000Cooking display layer.

Lower order appears earlier. CoreLib reads all registered layers and renders the final name and lore.

Namespace IDs are normalised on registration: trimmed, lowercased, spaces replaced with underscores, and a blank ID becomes unknown.

Name contributions

Layers may also decorate the item name. The position enum values are PREFIX and POSTFIX (there is no SUFFIX); an unknown or blank value falls back to POSTFIX.

Lore operation ledger

Each name_actions / lore_actions execution is recorded under the item PDC key emaki:item.operations with an operationId and a sourceNamespace, so a single module's changes can be reverted precisely:

MethodDescription
apply(itemStack, operationId, sourceNamespace, nameActions, loreActions, variables)Execute the operations and record them into PDC.
revert(itemStack, operationId)Revert one specific operation.
revertAll(itemStack, sourceNamespace)Revert every operation from one namespace.

Insert anchor behaviour

An empty anchor and an anchor that matches nothing do not behave the same way:

OperationEmpty anchoranchor matches nothing
insert_belowInsert at the end of the lore.Insert at the end of the lore.
insert_aboveInsert at the start of the lore.Insert at the end of the lore.

Anchors use contains matching and stop at the first matching line.

Advice

Store real state in PDC or payloads. Use lore only as presentation. When a module changes item state, request a proper refresh.