Item transform

Make an item be consumed then produced while keeping its data.

Item transform requirement combines both item input and output requirements.

It is used to consume an item, then produce another (or the same if needed).

The amounts of item consumed and produced are both customizable.

The input and output slots where the recipe will consume or produce items can be customized.

By default the requirement will keep the nbt data of the input item and put it to the output item (can be disabled).

The requirement type of item transform requirement is : "custommachinery:item_transform".

Properties

The item transform requirement has 2 mandatory properties and 8 optional properties.

Mandatory properties

"type": "custommachinery:item_transform" //Mandatory to define an item transform requirement.
Input

Name : input

Description :

An ingredient with one of the following syntax :

  • For items

"input": {
    "item": "item_id"
}

"item_id" is the registry name of the item you want to be consumed by the recipe.

It must be specified like namespace:item_registry_name with "namespace" being either "minecraft" if the item is from vanilla or a mod ID if the item is from a mod (ex : minecraft:diamond or mekanism:copper_ingot).

  • For tags

"input": {
    "tag": "tag_id"
}

"tag_id" is a tag grouping any item that can be consumed by the recipe.

Example :

"input": {
    "item": "minecraft:diamond"
}

The item consumed by the recipe will be a vanilla Diamond.

"input": {
    "tag": "minecraft:logs"
}

The recipe will consume any logs.

Optional properties

Input amount

Name : input_amount

Description :

A positive integer representing the amount of items consumed by the recipe.

Default : 1

Example :

"input_amount": 3

The recipe will consume 3 items.

Input slot

Name : input_slot

Description :

A string representing the ID of the slot where the recipe will consume items.

The slot must be an input slot.

Default : empty

The items will be consumed from any input slots.

Example :

"input_slot": "input1"

The recipe will consume items only from the slot with id "input1".

Output

Name : output

Description :

An item id, which represent the item that will be produced by the recipe.

Default :

If not specified, the produced item will be the same as the consumed item.

Example :

"output": "minecraft:diamond"

The recipe will produce a vanilla diamond.

Output amount

Name : output_amount

Description :

A positive integer representing the amount of items produced by the recipe.

Default : 1

Example :

"output_amount": 3

The recipe will produce 3 items.

Output slot

Name : output_slot

Description :

A string representing the ID of the slot where the recipe will produce items.

The slot must be an output slot.

Default : empty

The items will be produced to any output slots.

Example :

"output_slot": "output1"

The recipe will produce items only to the slot with id "output1".

Copy nbt

Name : copy_nbt

Description :

A boolean, representing whenever the produced item will have the same nbt as the consumed item, or not.

Default : true

The nbt data of the consumed item will be copied to the produced item.

Example :

"copy_nbt": false

The produced item will have no nbt data.

Chance

Name : chance

Description :

A double between 0.0 and 1.0 that define the chance of the requirement to be processed.

Default : 1

The requirement will always be processed.

Example :

"chance": 0.7

The requirement will have 70% chance to be processed.

Examples

A very simple item transform requirement that will consume a diorite to produce 2 andesite :

{
    "type": "custommachinery:item_transform",
    "input": {
        "item": "minecraft:diorite"
    },
    "output": "minecraft:andesite",
    "output_amount": 2
}

An item transform requirement that transform a diamond pickaxe placed in a slot with id "input1" in a diamond shovel while keeping its nbt data, including damage and enchants, and place it in a slot with id "output1" :

{
    "type": "custommachinery:item_transform",
    "input": {
        "tag": "minecraft:diamond_pickaxe"
    },
    "input_slot": "input1",
    "output": "minecraft:diamond_shovel",
    "output_slot": "output1"
}

Last updated