Skip to content

Advanced Config

Tyvor edited this page Jul 30, 2026 · 1 revision

Advanced Config

The advanced config is optional and is meant for modpack authors and server owners who need special-case rules.

File: config/armor-durability-cap-advanced.properties

How it works

The basic config always remains the base behavior.

The advanced config adds custom rules on top of it.

Each rule can:

  • target specific slots
  • target specific items
  • target item tags
  • target damage types
  • target damage tags
  • exclude items or tags
  • exclude damage types or tags
  • change cap values only for those matches
  • disable protection for a matching case and let vanilla behavior happen

How to enable it

  1. Open armor-durability-cap.properties
  2. Set:
advanced.generate_file=true
  1. Restart once
  2. Edit armor-durability-cap-advanced.properties
  3. Restart again

Rule order

Rules are listed here:

rules=vanilla_fire_behavior,boss_damage_template,pvp_template,specific_item_template

Rules are checked from left to right.

The first matching rule is used.

That means rule order matters.

What the advanced config inherits from

The advanced config does not replace the basic config.

Instead:

  • the basic config defines the global default behavior
  • each advanced rule overrides that behavior only when it matches

If an advanced rule leaves one of these fields empty, it inherits the value from the basic config:

  • max_percent
  • max_flat_damage
  • minimum_damage
  • rounding_mode
  • affect_modded_armor
  • enabled
  • protect

Filter fields do not inherit meaningfully. If a filter field is empty, that filter does not restrict matching.

Available rule fields

Each rule uses this format:

rules.my_rule_name.key=value

Example:

rules.my_rule_name.enabled=true
rules.my_rule_name.protect=true
rules.my_rule_name.items=minecraft:diamond_chestplate
rules.my_rule_name.max_percent=0.08

Full field reference

enabled

Type: true or false

Turns the rule on or off.

  • true = the rule may match
  • false = the rule is ignored

protect

Type: true or false

Controls whether the mod's cap logic is applied when the rule matches.

  • true = use Armor Durability Cap logic
  • false = use vanilla durability behavior for that match

This is how you create exceptions such as "fire uses vanilla behavior".

affect_modded_armor

Type: true or false

Controls whether the matching rule can affect compatible modded equippable damageable items that are not treated as plain armor internally.

  • true = include compatible modded equipment
  • false = only regular armor-like items

slots

Type: comma-separated list

Available values:

  • head
  • chest
  • legs
  • feet

If empty, any slot is allowed.

Example:

rules.chest_rule.slots=chest
rules.upper_rule.slots=head,chest

items

Type: comma-separated item ids

The rule only matches if the equipped item id is listed here.

If empty, any item id is allowed.

Example:

rules.item_rule.items=minecraft:diamond_chestplate,modid:item_name

exclude_items

Type: comma-separated item ids

The rule will not match if the equipped item id is listed here.

Example:

rules.general_rule.exclude_items=minecraft:elytra

item_tags

Type: comma-separated item tag ids

The rule only matches if the item has at least one listed tag.

Example:

rules.tag_rule.item_tags=c:armor/chestplates

exclude_item_tags

Type: comma-separated item tag ids

The rule will not match items that have any listed tag.

Example:

rules.tag_rule.exclude_item_tags=my_mod:no_cap_group

damage_types

Type: comma-separated damage type ids

The rule only matches if the damage source id is listed here.

Examples:

  • minecraft:on_fire
  • minecraft:dragon_breath
  • minecraft:wither_skull

exclude_damage_types

Type: comma-separated damage type ids

The rule will not match those damage types.

damage_tags

Type: comma-separated damage type tag ids

The rule only matches if the damage source has at least one listed damage tag.

Examples:

  • minecraft:is_fire
  • minecraft:is_explosion

exclude_damage_tags

Type: comma-separated damage type tag ids

The rule will not match damage sources that have any listed tag.

max_percent

Type: decimal number

Caps durability loss per hit as a fraction of total item durability.

Examples:

  • 0.20 = at most 20%
  • 0.05 = at most 5%
  • 0.01 = at most 1%

If empty in an advanced rule, the value from the basic config is used.

max_flat_damage

Type: integer

Adds a flat hard cap.

Examples:

  • -1 = disabled
  • 3 = never more than 3 durability damage
  • 1 = never more than 1 durability damage

If empty in an advanced rule, the value from the basic config is used.

minimum_damage

Type: integer

Sets the minimum final durability damage when positive armor damage is applied.

Examples:

  • 1 = always at least 1 durability damage
  • 0 = small values may become 0 after rounding

This is important for tiny percentages.

If your cap produces 0.4:

  • with FLOOR and minimum_damage=1, final result becomes 1
  • with FLOOR and minimum_damage=0, final result becomes 0

rounding_mode

Type:

  • FLOOR
  • ROUND
  • CEIL

Controls how decimal durability values are rounded.

  • FLOOR = round down
  • ROUND = standard rounding
  • CEIL = round up

If empty in an advanced rule, the value from the basic config is used.

Matching logic

Item side

For items:

  • if items and item_tags are both empty, the rule accepts any item
  • if either is filled, the item must match at least one of them
  • if exclude_items or exclude_item_tags match, the rule is rejected

Damage side

For damage:

  • if damage_types and damage_tags are both empty, the rule accepts any damage
  • if either is filled, the damage source must match at least one of them
  • if exclude_damage_types or exclude_damage_tags match, the rule is rejected

Important notes

There is no separate default rule inside the advanced file

In this version of the mod, the basic config is the actual default behavior.

The advanced config only contains custom rules listed in rules=....

protect=false is not "disable the rule"

It means:

  • the rule still matches
  • but vanilla durability behavior is used for that case

Empty filter fields do not mean zero matches

They mean "do not filter by this field".

Minimal template

rules=my_rule

rules.my_rule.enabled=true
rules.my_rule.protect=true
rules.my_rule.affect_modded_armor=true
rules.my_rule.slots=
rules.my_rule.items=
rules.my_rule.exclude_items=
rules.my_rule.item_tags=
rules.my_rule.exclude_item_tags=
rules.my_rule.damage_types=
rules.my_rule.exclude_damage_types=
rules.my_rule.damage_tags=
rules.my_rule.exclude_damage_tags=
rules.my_rule.max_percent=
rules.my_rule.max_flat_damage=
rules.my_rule.minimum_damage=
rules.my_rule.rounding_mode=

Clone this wiki locally