CoreLib Actions
When EmakiItem is enabled, it adds main-hand update, rerender, repair, durability, and vanilla Data Component add/modify/remove actions to the CoreLib action registry.
This page documents only CoreLib actions registered by EmakiItem. CoreLib built-in actions are documented in CoreLib Actions. Current action IDs use only the canonical names below; historical aliases are not registered.
Action IDs
| Action ID | Purpose | Parameters |
|---|---|---|
emakiitem_update | Forces the main-hand item through EmakiItem's update service. | none |
emakiitem_rerender | Rebuilds the main-hand item presentation through CoreLib item assembly. | none |
emakiitem_repair_amount | Repairs the main-hand item by a damage amount. | amount |
emakiitem_damage | Adds damage to the main-hand item. | amount |
emakiitem_set_damage | Sets the main-hand item's current damage value. | value |
emakiitem_set_durability | Sets the main-hand item's remaining durability value. | value |
emakiitem:component_add | Adds one Data Component and fails if it is already present. | component, value, optional slot |
emakiitem:component_modify | Modifies an existing Data Component and fails if it is absent. | component, value, optional slot |
emakiitem:component_remove | Removes one Data Component and idempotently skips if it is absent. | component, optional slot |
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
amount | INTEGER | Required by repair/damage actions | 0 | Repair or damage amount. Negative values are treated as 0. |
value | INTEGER | Required by durability set actions | 0 | Target damage value or target remaining durability value. |
component | STRING | Required by component actions | none | Data Component ID. IDs without a namespace resolve as minecraft:. |
value | STRING | Required by add/modify | none | JSON-ish value: JSON objects/arrays, quoted strings, booleans, numbers, null, and plain strings are supported. Malformed structured values fail validation. |
slot | STRING | No | Automatic target resolution | Explicit player inventory slot. An invalid explicit value fails instead of silently falling back. |
Component target resolution
Component actions resolve their target in this order:
- An explicit action
slotparameter. - The standard mutable Action holder
item_target(CoreActionItemTarget). - Compatibility context keys:
item,itemStack,item_stack,resultItem,result_item,targetItem, andtarget_item. - The current player's main hand.
Forge and Strengthen result actions provide item_target. After component actions update that holder, the calling module waits for the action chain, reads the final stack, and performs delivery. The component action does not insert a result item into the inventory early.
Supported slots
- Main hand:
main,mainhand,main_hand,hand,held,held_item,selected - Off hand:
offhand,off_hand - Armor:
head/helmet/armor_head,chest/chestplate/armor_chest,legs/leggings/armor_legs,feet/boots/armor_feet - Numeric slots:
0through40, includingslot_12andinventory_12 - Hotbar:
hotbar_0throughhotbar_8
Examples
actions:
- 'emakiitem_update'
- 'emakiitem_repair_amount amount=25'
- 'emakiitem:component_add component=max_stack_size value=16'
- 'emakiitem:component_modify component=enchantment_glint_override value=true slot=mainhand'
- 'emakiitem:component_remove component=custom_name slot=offhand'Use Action quoting for values containing spaces or structured content:
emakiitem:component_modify component=custom_name value='<gold>Forged Blade</gold>'
emakiitem:component_add component=custom_data value='{"emaki":{"source":"forge"}}'Notes
- Update and durability actions require a player context and operate on the main-hand item; they return skipped when the main hand is empty.
- Update and durability actions return
changed,damage, andmax_damagedata. emakiitem_set_durabilitymakes no change when the item has no maximum durability. Damage values are clamped to[0, max_damage], and dropping below the maximum clears the repair disabled flag.- Component actions may target an explicit slot, a cross-module result holder, or a context ItemStack. They fail when no usable target exists.
- Component patches are applied through CoreLib
ConfiguredItemDefinition, preserving third-party source identity, PDC, and unrelated components. - Component actions return
operation,component,target,changed,existed_before,warnings, andissuesdata for later actions and diagnostics.