Skip to content

Result Processors ​

Result processors rewrite the components of a recipe's result item when the craft completes: copy them from the source item, write fixed values, merge with the source, or remove them.

Supported Recipe Types ​

Recipe Typetype valueStatus
Anvilanvil✅ Supported
Smithing transformvanilla_smithing_transform✅ Supported
Furnace smeltingvanilla_smelting_*✅ Supported
Brewing standvanilla_brewing✅ Supported
Shaped recipevanilla_shaped✅ Supported
Shapeless recipevanilla_shapeless✅ Supported
Stonecuttervanilla_stonecutting✅ Supported (Paper and forks only)

Basic Syntax ​

yaml
type: <recipe type>
result: '<item id>'
# ... other recipe fields

result_processors:
  <component>:
    type: <strategy>
    data:      # optional, depending on the strategy
      <config>

Single Action and Multiple Actions ​

When a component only needs one action, write type (and data) directly. To run several actions on the same component in order, use a list:

yaml
result_processors:
  enchantments:
    - type: copy_from_source
    - type: remove
      data:
        value:
          - "minecraft:sharpness"
    - type: add
      data:
        minecraft:unbreaking: 3

Components are also processed in the order they appear under result_processors, so a later action overwrites what an earlier one wrote.

What Happens When the Config Is Wrong ​

  • Unknown component (including components the current server version does not support): logs Unknown component: <name>, skips it, and the recipe still loads normally.
  • Unsupported strategy (for example add on all): logs a warning and skips that action.
  • Missing or malformed data: most components log a warning and skip the action; a few (such as add of custom_persistent_data) fail with an error.

Rule of thumb: if a recipe loads but the result is missing an effect, check the console for messages such as Unknown component or missing 'value'.

Source Item ​

Strategies copy_from_source and merge_source read from a "source" item, which differs by recipe type:

Recipe TypeSource Item
Anvil / Smithingthe base item (left or middle slot)
Smelting / Stonecutting / Brewingthe input item
Crafting table (shaped / shapeless)no source item

Crafting table recipes have no source item. copy_from_source and merge_source do not fail there, but they do nothing. Use add or remove for crafting table recipes.

Strategies ​

StrategyEffectOn conflict
copy_from_sourceOverwrite the result's component with the source'ssource wins
merge_sourceMerge the source's component into the resultresult wins (existing values kept)
addMerge the data content into the resultdata wins (overwrites same entries)
setClear the component, then write datano conflict
removeRemove all or selected content—

add and merge_source both merge; the only difference is who wins a conflict. Use set when you want a full replacement.

set performs a full replacement and is provided by the components that can hold multiple entries: lore, enchantments, attributes, item flags and persistent data. For single-value components (name, rarity, durability and so on) add already replaces the value, so there is no set. Each component below lists the strategies it actually supports; anything else is skipped at load time.

Scripted Values ​

Numeric, boolean and some text fields can be computed by a script instead of being hard-coded: scale an enchantment with the player's level, use a PlaceholderAPI value, or make the result's skull show its crafter.

yaml
result_processors:
  enchantments:
    type: add
    data:
      minecraft:sharpness: '<max(1, level() / 10)>'
  skull_profile:
    type: add
    data:
      name: '<invoker_name()>'
  lore:
    type: add
    data:
      value:
        - '<"&7Forged by " + player.get("name")>'

Fields that accept scripts:

ComponentField
enchantmentslevel of each enchantment
attributesamount
custom_model_datavalue
damagevalue / damage
max_stack_sizevalue
max_damagevalue
enchantablevalue
use_cooldownseconds
unbreakable, hide_tooltip, fire_resistance, enchantment_glint_override, glidervalue
skull_profilename, uuid
display_name, item_namevalue
loreeach line of value

lore supports scripts in add / set; remove still matches lines literally. Text fields evaluate the script first, then apply colour codes and PlaceholderAPI variables.

Available Variables ​

VariableDescription
playerThe player who triggered the craft, a Player object; absent in player-less contexts (such as dispenser crafting)
source_itemThe source item, an ItemStack object; absent for crafting table recipes
result_itemThe current result item, an ItemStack object

Read object properties with get("property"), for example player.get("level") or source_item.get("amount"). See Script Engine and Built-in Functions for syntax, operators and available functions.

When Something Is Wrong ​

  • Syntax error: one warning in the console, the field falls back to its default value, and the recipe still loads
  • Evaluation failure (division by zero, wrong type, missing variable): one warning and that value is skipped; for lists such as enchantments, attributes and lore only the failing entry is skipped
  • Out-of-range value: clamped by the component's own rules (stack size 1..99, max damage at least 1, non-negative cooldown)

Notes ​

  • Quote single-line scripts so a # inside the script is not treated as a YAML comment
  • Angle brackets mean "script", not a placeholder; <...> must wrap the whole field, an inline <...> in the middle of a text is not evaluated
  • player is a script variable, see get("...") above
  • Decimals are truncated when the field expects an integer; use round(...) if you need rounding

Common Components ​

The following components work on every server version the plugin supports (1.20+).

all ​

Copies every component of the source item.

StrategyDescription
copy_from_sourceFully overwrite the result's components with the source's

all can only copy from the source, so it does not support add / set / remove.

yaml
# Smithing: keep all data of the base item (enchants, damage, name, ...)
result_processors:
  all:
    type: copy_from_source

display_name ​

The item's custom display name (the legacy name).

StrategyDescription
copy_from_sourceCopy the source's custom name if it has one
addvalue is the name string; color codes and PlaceholderAPI variables work
removeRemove the custom name and fall back to the default
yaml
result_processors:
  display_name:
    type: add
    data:
      value: '&6&lLegendary Sword'
    # replace or remove instead:
    # type: set
    # type: remove

On 1.20.5+ use item_name below for the item name component.

lore ​

The item's lore.

StrategyDescription
copy_from_sourceReplace the result's lore with the source's lore
merge_sourceKeep the result's lore first, then append the source's lore
addAppend the lines in value after the existing lore; color codes and PlaceholderAPI variables work
setClear the existing lore, then write the lines in value
removeWithout data, clears all lore; with value, removes lines that match exactly
yaml
result_processors:
  lore:
    # append two lines after the existing lore
    type: add
    data:
      value:
        - '&7A legendary artifact'
        - '&aForged from a nether star'

    # to replace the whole lore instead:
    # type: set
    # data:
    #   value:
    #     - '&7A legendary artifact'

    # to remove specific lines:
    # type: remove
    # data:
    #   value:
    #     - '&7A legendary artifact'

remove matches lines exactly, so a line with color codes must be written with the same color codes to match.

enchantments ​

Vanilla enchantments.

StrategyDescription
copy_from_sourceCopy the source's enchantments; writes the source level when the result lacks it or when the source level is not lower
merge_sourceOnly overwrite an existing enchantment when the source level is higher
adddata maps enchantment id: level; an existing enchantment is overwritten
setClear all enchantments first, then write
removeWithout data, clears every enchantment; with value, removes the listed ones
yaml
result_processors:
  enchantments:
    type: add
    data:
      minecraft:sharpness: 5
      minecraft:mending: 1

    # keep only the listed enchantments:
    # type: set
    # data:
    #   minecraft:sharpness: 10

    # remove specific enchantments:
    # type: remove
    # data:
    #   value:
    #     - "minecraft:sharpness"

attributes ​

Attribute modifiers of the item.

StrategyDescription
copy_from_sourceReplace the result's modifiers with the source's
merge_sourceAppend the source's modifiers; the same attribute may appear twice
addvalue is a list of modifiers, each with attribute, amount, operation, slot
setClear the result's modifiers first, then write
removeWithout data, clears every modifier; with value, removes all modifiers of the listed attributes

Fields of add:

FieldRequiredDescription
attributeYesAttribute id, e.g. minecraft:generic.attack_damage
amountYesNumeric value
operationNoADD_NUMBER (default), ADD_SCALAR, MULTIPLY_SCALAR_1
slotNoTarget slot group, default any; 1.20.5+ uses mainhand, offhand, hand, armor, any, older versions use HAND, OFF_HAND, HEAD, ...
yaml
result_processors:
  attributes:
    type: add
    data:
      value:
        - attribute: 'minecraft:generic.attack_damage'
          amount: 10
          operation: ADD_NUMBER
          slot: mainhand
        - attribute: 'minecraft:generic.movement_speed'
          amount: 0.1
          operation: MULTIPLY_SCALAR_1

    # clear first, then write:
    # type: set
    # data:
    #   value:
    #     - attribute: 'minecraft:generic.attack_damage'
    #       amount: 20

add does not merge modifiers of the same attribute: writing the same attribute again makes both apply, and the values stack. To replace an attribute, remove it first and then add the new value.

item_flag ​

Item flags (hide enchantments, hide attributes, ...).

StrategyDescription
copy_from_sourceFully replace the result's flags with the source's
merge_sourceOnly append flags the result does not have yet
addAppend the flags in value
setClear the result's flags first, then write
removeWithout data, clears every flag; with value, removes the listed ones

Flag names use Bukkit enum names such as HIDE_ENCHANTS, HIDE_ATTRIBUTES, HIDE_UNBREAKABLE, HIDE_DYE.

yaml
result_processors:
  item_flag:
    type: add
    data:
      value:
        - 'HIDE_ENCHANTS'
        - 'HIDE_ATTRIBUTES'

    # keep only the listed flags:
    # type: set
    # data:
    #   value:
    #     - 'HIDE_ENCHANTS'

trim ​

Armor trim, only effective on armor items.

StrategyDescription
copy_from_sourceCopy the trim when the source has one
addSet the trim with pattern and material; both must resolve, otherwise the action is skipped
removeRemove the trim
yaml
result_processors:
  trim:
    type: add
    data:
      pattern: 'minecraft:spire'
      material: 'minecraft:netherite'

unbreakable ​

The unbreakable flag.

StrategyDescription
copy_from_sourceFollow the source's unbreakable state
addvalue is true or false
removeRemove the unbreakable flag
yaml
result_processors:
  unbreakable:
    type: add
    data:
      value: true

custom_model_data ​

Legacy custom model data (an integer).

StrategyDescription
copy_from_sourceCopy the value from the source
addvalue is an integer
removeRemove the value
yaml
result_processors:
  custom_model_data:
    type: add
    data:
      value: 1001

On 1.21.4+ use custom_model_data_component below instead.

damage ​

Damage already taken by the result item.

StrategyDescription
copy_from_sourceCopy the damage value when the source has one
addvalue (or damage) is the damage; allow_exceed_max controls whether it may exceed max durability
removeReset the damage to zero
yaml
result_processors:
  damage:
    type: add
    data:
      value: 50
      allow_exceed_max: false

By default a value above the item's max durability is clamped to the limit with a console warning; set allow_exceed_max: true to bypass the clamp.

base_color ​

Leather armor color, only effective on leather armor.

StrategyDescription
copy_from_sourceCopy the source's color when it has one
addvalue is '#RRGGBB' or 'r,g,b'
removeReset to the default leather color
yaml
result_processors:
  base_color:
    type: add
    data:
      value: '#3F76E4'
    # this also works:
    # value: '63,118,228'

skull_profile ​

The skin of a skull item, only effective on skulls.

StrategyDescription
copy_from_sourceCopy the source's skin
addSet the owner with name / uuid
removeClear the skin

add fields:

FieldRequiredDescription
nameat least one of the twoPlayer name
uuidat least one of the twoPlayer UUID
yaml
result_processors:
  skull_profile:
    type: add
    data:
      name: 'Notch'
      uuid: '069a79f4-44e9-4726-a5be-fca90e38aaf5'   # optional

Write at least one of name and uuid; both are fine. When the player is online their current profile is reused and the skin shows immediately; when they are offline name wins, and with uuid alone the skin is looked up by UUID. Both fields accept scripts: name: '<invoker_name()>' produces the crafter's head.

add carries no skin data itself — the server resolves the texture

yaml
result_processors:
  skull_profile:
    type: copy_from_source

1.20.5+ Components ​

These require server 1.20.5 or newer; older versions log Unknown component and skip them.

food ​

Food properties such as nutrition and saturation.

StrategyDescription
copy_from_sourceCopy the source's food properties if it has any
removeRemove the food properties

There is no add / set: food properties contain many fields and cannot be built from a simple config.

yaml
result_processors:
  food:
    type: copy_from_source

hide_tooltip ​

Whether the whole tooltip is hidden.

StrategyDescription
copy_from_sourceFollow the source's setting
addvalue is true or false
removeShow the tooltip again
yaml
result_processors:
  hide_tooltip:
    type: add
    data:
      value: true

item_name ​

The item name component.

StrategyDescription
copy_from_sourceCopy the source's name component if it has one
addvalue is the name string; color codes and PlaceholderAPI variables work
removeRemove the name component
yaml
result_processors:
  item_name:
    type: add
    data:
      value: '&b%player_name%&f''s sword'

max_stack_size ​

The maximum stack size.

StrategyDescription
copy_from_sourceCopy the source's stack size
addvalue is an integer
removeRestore the item's default stack size
yaml
result_processors:
  max_stack_size:
    type: add
    data:
      value: 16

rarity ​

Item rarity, which also decides the name color.

StrategyDescription
copy_from_sourceCopy the source's rarity
addvalue is COMMON, UNCOMMON, RARE or EPIC
removeRestore the default rarity
yaml
result_processors:
  rarity:
    type: add
    data:
      value: EPIC

fire_resistance ​

Whether the item survives lava and fire.

StrategyDescription
copy_from_sourceFollow the source
addvalue is true or false; defaults to true when omitted
removeTurn fire resistance off
yaml
result_processors:
  fire_resistance:
    type: add
    data:
      value: true

max_damage ​

The maximum durability, independent from damage.

StrategyDescription
copy_from_sourceCopy the source's max durability
addvalue is a positive integer
removeRestore the item's default durability
yaml
result_processors:
  max_damage:
    type: add
    data:
      value: 3000

enchantment_glint_override ​

Force the enchantment glint on or off.

StrategyDescription
copy_from_sourceCopy the source's setting
addvalue is true (show glint) or false (hide glint)
removeRemove the override and use the default behavior
yaml
result_processors:
  enchantment_glint_override:
    type: add
    data:
      value: true

potion ​

The base potion type (swiftness, healing, ...), only effective on potions.

StrategyDescription
copy_from_sourceCopy the source's base potion type if it has one
removeRemove the base potion type
yaml
result_processors:
  potion:
    type: copy_from_source

1.21+ Components ​

tool ​

The tool component (mining speed, mineable blocks, ...), requires 1.21+.

StrategyDescription
copy_from_sourceCopy the source's tool component
removeRemove the tool component
yaml
result_processors:
  tool:
    type: copy_from_source

1.21.2+ Components ​

These require server 1.21.2 or newer.

glider ​

Whether the item glides like an elytra.

StrategyDescription
copy_from_sourceFollow the source
addvalue is true or false
removeTurn gliding off
yaml
result_processors:
  glider:
    type: add
    data:
      value: true

enchantable ​

The item's enchantability, which affects enchantment table results.

StrategyDescription
copy_from_sourceCopy the source's enchantability
addvalue is an integer
removeRestore the item's default value
yaml
result_processors:
  enchantable:
    type: add
    data:
      value: 30

tooltip_style ​

The tooltip style, which requires a matching definition in a resource pack.

StrategyDescription
copy_from_sourceCopy the source's style
addvalue is namespace:id, e.g. mypack:custom_tooltip
removeRemove the style
yaml
result_processors:
  tooltip_style:
    type: add
    data:
      value: 'mypack:custom_tooltip'

use_cooldown ​

The item's use cooldown.

StrategyDescription
copy_from_sourceCopy the source's cooldown and cooldown group
addseconds is the cooldown in seconds; group is the cooldown group (optional)
removeRemove the cooldown
yaml
result_processors:
  use_cooldown:
    type: add
    data:
      seconds: 5
      group: 'craftorithm:special_items'

Items sharing the same group share the cooldown: using one puts the others on cooldown too.

damage_resistant ​

Immunity to specific damage types, requires 1.21.2+.

StrategyDescription
copy_from_sourceCopy the source's resistance
removeRemove the resistance
yaml
result_processors:
  damage_resistant:
    type: copy_from_source

1.21.4+ Components ​

These require server 1.21.4 or newer.

custom_model_data_component ​

The newer custom model data component (may hold multiple floats and strings).

StrategyDescription
copy_from_sourceCopy the source's component data
removeRemove the component
yaml
result_processors:
  custom_model_data_component:
    type: copy_from_source

item_model ​

The model used by the item.

StrategyDescription
copy_from_sourceCopy the source's model
addvalue is namespace:id, e.g. mypack:custom_model
removeRemove the model
yaml
result_processors:
  item_model:
    type: add
    data:
      value: 'mypack:ruby_sword'

Special Components ​

custom_persistent_data ​

Persistent data (PDC) of the item, commonly used to tag items for scripts or other plugins.

StrategyDescription
copy_from_sourceWithout data, copies every key of the source; with key and type, copies only that key
merge_sourceOnly adds keys the result does not have; existing keys keep the result's value
adddata maps namespace:key: value; existing keys are overwritten
setClear every key first, then write
removeWithout data, clears every key; with value, removes the listed keys

The value type of add follows the YAML value: strings, integers, decimals and booleans are written as their own type, anything else as a string.

yaml
result_processors:
  custom_persistent_data:
    # write two keys
    type: add
    data:
      myns:item_type: 'ruby_sword'
      myns:power: 42
      myns:bound: true

    # copy a single key from the source:
    # type: copy_from_source
    # data:
    #   key: 'myns:quality'
    #   type: STRING

    # only add keys the result is missing:
    # type: merge_source

    # clear every key:
    # type: remove

    # remove specific keys:
    # type: remove
    # data:
    #   value:
    #     - 'myns:item_type'
    #     - 'myns:power'

When using key with copy_from_source or merge_source, type is required as well, otherwise every key is processed. Valid type values include STRING, INTEGER, LONG, DOUBLE, FLOAT, BYTE and BOOLEAN.

Using with AdvancedEnchantments ​

With AdvancedEnchantments installed, the ae_enchantments component handles its custom enchantments.

StrategyDescription
copy_from_sourceCopy the source's custom enchantments
merge_sourceOnly overwrite an existing level when the source level is higher
removeRemove every custom enchantment from the result
yaml
result_processors:
  ae_enchantments:
    type: copy_from_source

Legacy Syntax ​

The old copy_components_rules syntax still works; each entry is converted to copy_from_source of the matching component:

yaml
# old syntax
copy_components_rules:
  - 'enchantments'
  - 'display_name'
  - 'lore'

# equivalent to
result_processors:
  enchantments:
    type: copy_from_source
  display_name:
    type: copy_from_source
  lore:
    type: copy_from_source

The legacy syntax only works for anvil and smithing recipes (vanilla_smithing_transform, vanilla_smithing_trim); use result_processors for other recipe types. When both copy_components_rules and result_processors are present, only the latter is used.

Complete Examples ​

Anvil: keep base data and append lore ​

yaml
type: anvil
result: 'minecraft:diamond_sword'
base: 'minecraft:netherite_sword'
addition: 'minecraft:nether_star'
cost_level: 10

result_processors:
  # copy enchantments and the display name from the base item
  enchantments:
    type: copy_from_source
  display_name:
    type: copy_from_source

  # append two lines after the existing lore (the base lore is kept)
  lore:
    type: add
    data:
      value:
        - '&7A legendary artifact'
        - '&aForged from a nether star'

  # merge the base attributes
  attributes:
    type: merge_source

  # hide enchantment and attribute tooltips
  item_flag:
    type: add
    data:
      value:
        - 'HIDE_ENCHANTS'
        - 'HIDE_ATTRIBUTES'

  # make it unbreakable
  unbreakable:
    type: add
    data:
      value: true

  # tag it so scripts can recognize it
  custom_persistent_data:
    type: add
    data:
      myns:legendary: true

Smithing: overwrite everything ​

yaml
type: 'vanilla_smithing_transform'
result: 'minecraft:netherite_sword'
base: 'minecraft:diamond_sword'
addition: 'minecraft:netherite_ingot'
template: 'minecraft:netherite_upgrade_smithing_template'

result_processors:
  # copy every component of the base
  all:
    type: copy_from_source

  # then add one more enchantment
  enchantments:
    type: add
    data:
      minecraft:sharpness: 5

Crafting table: write fixed content ​

Crafting table recipes have no source item, so only add / remove (plus set on multi-entry components) are useful:

yaml
type: 'vanilla_shaped'
result: 'minecraft:bread'
pattern:
  - 'AAA'
ingredients:
  A: 'minecraft:wheat'

result_processors:
  lore:
    type: set
    data:
      value:
        - '&7Bread made from three wheat'
  rarity:
    type: add
    data:
      value: UNCOMMON

Smelting: append a line only ​

yaml
type: 'vanilla_smelting_furnace'
result: 'minecraft:diamond'
source: 'minecraft:coal_ore'
experience: 1.0
cooking_time: 200

result_processors:
  lore:
    type: add
    data:
      value:
        - '&7Obtained by smelting'

基于 MIT 许可证发布