Default Cost

Set the base repair cost applied to all items

DefaultRepairCost defines the base repair cost applied to all items. Any item that does not match a pattern in CustomRepairCosts will use these values.

{
  "DefaultRepairCost": {
    "ItemId": "Ingredient_Bar_Iron",
    "Quantity": 2,
    "ScalingFactor": 1.0,
    "RepairMaxDurability": true,
    "MaxDurabilityLoss": 0.0
  }
}

Properties

ItemId

Type: String | Default: "Ingredient_Bar_Iron" | Optional

The specific item required to pay for a repair. Use this when you want an exact item as the repair material.

Only one of ItemId or ResourceTypeId should be set. If both are present, ItemId takes priority. If neither is set, the plugin defaults to "Ingredient_Bar_Iron" and logs a notice.

"ItemId": "Ingredient_Bar_Iron"

Common values:

Value
Description

Ingredient_Bar_Iron

Iron bar

Ingredient_Bar_Copper

Copper bar

Ingredient_Bar_Adamantite

Adamantite bar

Ingredient_Stick

Stick


ResourceTypeId

Type: String | Default: None | Optional

A resource category used as the repair material instead of a specific item. Any item belonging to this resource type will be accepted.

Only one of ItemId or ResourceTypeId should be set. If both are present, ItemId takes priority.

Common values:

Value
Description

Wood_Trunk

Any wood trunk item

Rock

Any rock item

Rubble

Any rubble item

Fuel

Any fuel item

See the Resource Types page for a full list and custom icon support.


Quantity

Type: Integer | Default: 2 | Optional

The base number of materials required to perform a repair. This value is used as-is when ScalingFactor is 0.0, or as the baseline for the scaling formula when ScalingFactor is greater than 0.0.


ScalingFactor

Type: Double | Default: 1.0 | Optional

Controls how much the repair cost increases based on how damaged the item is. A value of 0.0 means the cost is always equal to Quantity, regardless of damage. Higher values make heavily damaged items more expensive to repair.

Value
Behaviour

0.0

Cost is always equal to Quantity

1.0

Cost scales linearly with damage

2.0

Cost scales at twice the rate

Formula:

FinalCost=max(0,Quantity×(1+ScalingFactor×(1CurrentDurabilityMaxDurability))+0.5)\text{FinalCost} = \max\left(0, \left\lfloor \text{Quantity} \times \left(1 + \text{ScalingFactor} \times \left(1 - \frac{\text{CurrentDurability}}{\text{MaxDurability}}\right)\right) + 0.5 \right\rfloor\right)

Where MaxDurability is the higher of the item's current max durability and its base definition max durability.


RepairMaxDurability

Type: Boolean | Default: true | Optional

Controls whether a repair fully restores an item's maximum durability. When true, the item's max durability is restored toward its original value during repair. When false, the repair only restores current durability up to the existing max — permanent durability loss is not recovered.

This property must be set to false for MaxDurabilityLoss to have any effect. If RepairMaxDurability is true and MaxDurabilityLoss is greater than 0.0, the plugin will force MaxDurabilityLoss to 0.0 and log a warning.


MaxDurabilityLoss

Type: Double | Default: 0.0 | Optional

The percentage of the damage taken that is permanently removed from the item's maximum durability each time it is repaired. For example, a value of 0.5 means that 50% of the damage taken is permanently lost from max durability after the repair is applied.

RepairMaxDurability must be set to false for this property to have any effect. If RepairMaxDurability is true, this value will be forced to 0.0 by the plugin regardless of what is set in the config.

If the calculated loss would reduce the item's max durability to 0 or below, the repair is blocked entirely and will not proceed.

Formula:

NewMaxDurability=CurrentMaxDurabilityLossAmount\text{NewMaxDurability} = \text{CurrentMaxDurability} - \text{LossAmount}
LossAmount=max((CurrentMaxDurabilityCurrentDurability)×MaxDurabilityLoss, 1)\text{LossAmount} = \max\left((\text{CurrentMaxDurability} - \text{CurrentDurability}) \times \text{MaxDurabilityLoss},\ 1\right)

The minimum loss is always 1, even if the calculated value is less. If NewMaxDurability is less than or equal to 0, the repair is cancelled.


Rules Summary

Scenario
Outcome
Required

ItemId

Must be set unless ResourceTypeId is provided.

Yes

ResourceTypeId

Must be set unless ItemId is provided.

Yes

Quantity

Must be set. Defaults to 2 if missing.

Yes

ScalingFactor

Must be set. Defaults to 1.0 if missing.

Yes

RepairMaxDurability

Must be set. Defaults to true if missing.

Yes

MaxDurabilityLoss

Must be set. Defaults to 0.0 if missing.

Yes

RepairMaxDurability: true and MaxDurabilityLoss > 0

MaxDurabilityLoss is forced to 0.0. A warning is logged.

RepairMaxDurability: false and MaxDurabilityLoss > 0

Permanent durability loss is applied on repair.

MaxDurabilityLoss applied would reduce max durability to 0 or below

Repair is blocked. The player cannot repair the item.

Neither ItemId nor ResourceTypeId is set

ItemId defaults to "Ingredient_Bar_Iron". A notice is logged.

Both ItemId and ResourceTypeId are set

ItemId takes priority. ResourceTypeId is removed.


Complete Example

In this example, all items cost iron bars to repair. The cost scales with damage. Each repair permanently removes 10% of the damage taken from the item's max durability.

Last updated