Durability
Make the recipe damage or repair items
Durability requirement is used to damage or repair items in inputs slots.
To use it you need to provide the registry name of the item and the amount of durability you want the recipe to damage/repair.
This requirement is available in both input and output modes.
The requirement type of durability requirement is : "custommachinery:durability".
Properties
The durability requirement has 4 mandatory properties and 3 optional properties.
Mandatory properties
"type": "custommachinery:durability" //Mandatory to define a durability requirement.Mode
Name : mode
modeDescription :
Define when the requirement will be processed and what it does.
inputWhen starting to craft the recipe, the machine will consume the desired amount of the specified item durability from the input slot they are in.outputWhen finishing to craft the recipe, the machine will repair the desired amount of the specified item durability. The item must still be in an input slot.
Example :
"mode": "input"The requirement will consume durability at the start of the crafting process.
Ingredient
Name : ingredient
ingredientDescription :
An ingredient with one of the following syntax :
For items
"ingredient": {
"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
"ingredient": {
"tag": "tag_id"
}"tag_id" is a tag grouping any item that can be consumed by the recipe.
Example :
"ingredient": {
"item": "minecraft:diamond"
}The item damaged/repaired by the recipe will be a vanilla Diamond.
Note :
You can see an item registry name by activating advanced infos (F3 + H in-game) and hovering the item in an inventory.
Optional properties
Chance
Name : chance
chanceDescription :
A double between 0.0 and 1.0 that define the chance of the item to be damaged if input or repaired if output, the chance is applied for the whole stack defined in this requirement.
Default : 1
The item will always be damaged/repaired.
Example :
The item will have 70% chance to be damaged/repaired.
Slot
Name : slot
slotDescription :
The slot id of a slot you want to force the player to put the item in. The slot id must be exactly the same as the one specified in the Item Component ID property or it will not work.
Default : empty
emptyThe item can be put in any slot.
Example :
The item will be input/output only in the slot with id input1.
Example
An Durability Requirement that will make the recipe damage a vanilla diamond pickaxe 50 durability points:
Last updated