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 :

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).

An item tag can be specified instead, by using the # prefix like #minecraft:logs.

Example :

"input": "minecraft:diamond"

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

"input": "#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".

Input nbt

Name : input_nbt

Description :

A string that represent a nbt tag that will be required on the input item.

The machine will search for items in input slots that have AT LEAST those nbt tag, if the item have more tag it's fine as long as it have all the tags specified in this property.

The nbt tag must be defined the same way you use it in the /give command.

You can see the nbt tag of the item in your hand using /data get entity @s SelectedItem and then copy the part after tag: inside {}.

Default : empty

The input item can have any nbt tag, or nothing.

Example :

"nbt": "{'test1': true, 'Amount': 10}"

The item requirement will search for items with nbt tag "test1" with value true and tag "Amount" with value 10.

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": "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": "minecraft:diamond_pickaxe",
    "input_slot": "input1",
    "output": "minecraft:diamond_shovel",
    "output_slot": "output1"
}

Last updated