Skip to content

Item Repair

The repair system lets equipment enter a disabled state when durability would break instead of disappearing. Players can repair disabled equipment with configured materials.

Disabled durability behavior

When durability is about to reach zero:

  1. PlayerItemDamageEvent is cancelled so the item does not disappear.
  2. Item damage is set to max damage and the item is marked disabled.
  3. PDC stores the disabled flag.
  4. Triggers do not run while the item is disabled, and combat interactions can be blocked.

Configuration

repair is a top-level field in an item definition.

FieldDescription
enabledWhether repair is enabled.
materialsRepair material list.
disabled_displayPresentation changes while disabled.
on_disabledActions executed when the item becomes disabled.
on_repairedActions executed after repair.

Material fields

FieldDescription
itemMaterial item source, such as minecraft-diamond.
amountRequired amount.
restoreDurability restored. Supports fixed values like 250 or percentages like 50%.

Example

yaml
repair:
  enabled: true
  materials:
    - item: "minecraft-NETHERITE_INGOT"
      amount: 1
      restore: "50%"
    - item: "minecraft-DIAMOND"
      amount: 3
      restore: 200
  disabled_display:
    name_prefix: "<red>[Broken] "
    lore_append:
      - ""
      - "<red>This equipment is broken."
      - "<gray>Click it with repair material to repair."
  on_disabled:
    - 'sendmessage text="<red>Your equipment broke!"'
  on_repaired:
    - 'sendmessage text="<green>Equipment repaired!"'