编辑

Items Documentation - minecraft:repairable

Defines the items that can be used to repair a defined item, and the amount of durability each item restores upon repair. Each entry needs to define a list of strings for 'items' that can be used for the repair and an optional 'repair_amount' for how much durability is repaired.

Item Components Repairable Properties

Name Default Value Type Description Example Values
repair_items [] String List of repair item entries. Each entry needs to define a list of strings for items that can be used for the repair and an optional repair_amount for how much durability is gained. Chestplate: [{"items":["minecraft:stick"],"repair_amount":"context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"}], My Sword Chuck: [{"items":["minecraft:diamond"],"repair_amount":"query.max_durability * 0.25"}]
repair_items (Repair Items) not set Repair Items (Repair Items) item

Repair Items (Repair Items)

Repair Items Properties

JSON path: repair_items

Name Default Value Type Description
items not set String Items that may be used to repair an item.
items (as Keyed set of strings) not set Keyed set of strings
repair_amount {"expression":"","version":-1} Keyed set of strings How much the item is repaired.
repair_amount (Repair Amount) not set Key/item pairs of Repair Amount (Repair Amount) items
repair_amount (as Decimal number) not set Decimal number

Repair Amount (Repair Amount)

Repair Amount Properties

JSON path: repair_items > repair_amount

Name Default Value Type Description
expression not set String
version not set Integer number

Samples

"minecraft:repairable": {
  "on_repaired": "minecraft:celebrate",
  "repair_items": [
    "anvil"
  ]
}

Chestplate

"minecraft:repairable": {
  "repair_items": [
    {
      "items": [
        "minecraft:stick"
      ],
      "repair_amount": "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
    }
  ]
}

My Sword Chuck

"minecraft:repairable": {
  "repair_items": [
    {
      "items": [
        "minecraft:diamond"
      ],
      "repair_amount": "query.max_durability * 0.25"
    }
  ]
}