-
Notifications
You must be signed in to change notification settings - Fork 17
Durability Requirement
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"
.
The Durability Requirement have 4 mandatory properties and 3 optional properties.
Type
"type": "custommachinery:durability"
Mode
Define when the requirement will be processed and what it does.
-
input
When starting to craft the recipe, the machine will consume the desired amount of the specified item durability from the input slot they are in. -
output
When 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.
"mode": "input"
The requirement will consume durability at the start of the crafting process.
Item
The registry name of the item you want to damage/repair.
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").
"item": "minecraft:diamond"
The item damaged/repaired by the recipe will be a vanilla Diamond.
You can see an item registry name by activating advanced infos (F3 + H in-game) and hovering the item in an inventory.
Amount
An integer that define the amount of durability you want to remove/add to the specified item.
"amount": 16
The recipe will damage/repair the specified item 16 durability.
Chance
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.
"chance": 1.0
The item will always be damaged/repaired.
"chance": 0.7
The item will have 70% chance to be damaged/repaired.
NBT
A string that represent a nbt tag that will be required on the item. Only item that have all nbt tags specified here will be damaged/repaired.
You can see the nbt tag of an item using /data get entity @s SelectedItem
and then copy the part after tag:
inside {}.
Nothing, no nbt tags required ot added.
"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.
Slot
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.
Empty, the item can be put in any slot.
"slot": "input1"
The item will be input/output only in the slot with id input1
.
An Durability Requirement that will make the recipe damage a vanilla diamond pickaxe 50 durability points:
{
"type": "custommachinery:durability",
"mode": "input",
"item": "minecraft:diamond_pickaxe",
"amount": 50
}
3. Machine GUI
- Dump Element
- Energy Element
- Fluid Element
- Fuel Element
- Player Inventory Element
- Progress Bar Element
- Reset Element
- Slot Element
- Status Element
- Text Element
- Texture Element
5. Catalysts
- Biome Requirement
- Block Requirement
- Command Requirement
- Dimension Requirement
- Drop Requirement
- Durability Requirement
- Effect Requirement
- Energy Requirement
- Energy Per Tick Requirement
- Entity Requirement
- Fluid Requirement
- Fluid Per Tick Requirement
- Fuel Requirement
- Item Requirement
- Light Requirement
- Loot Table Requirement
- Position Requirement
- Structure Requirement
- Redstone Requirement
- Time Requirement
- Weather Requirement