-
Notifications
You must be signed in to change notification settings - Fork 0
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
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
- Open
armor-durability-cap.properties - Set:
advanced.generate_file=true- Restart once
- Edit
armor-durability-cap-advanced.properties - Restart again
Rules are listed here:
rules=vanilla_fire_behavior,boss_damage_template,pvp_template,specific_item_templateRules are checked from left to right.
The first matching rule is used.
That means rule order matters.
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_percentmax_flat_damageminimum_damagerounding_modeaffect_modded_armorenabledprotect
Filter fields do not inherit meaningfully. If a filter field is empty, that filter does not restrict matching.
Each rule uses this format:
rules.my_rule_name.key=valueExample:
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.08Type:
true or false
Turns the rule on or off.
-
true= the rule may match -
false= the rule is ignored
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".
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
Type: comma-separated list
Available values:
headchestlegsfeet
If empty, any slot is allowed.
Example:
rules.chest_rule.slots=chest
rules.upper_rule.slots=head,chestType: 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_nameType: comma-separated item ids
The rule will not match if the equipped item id is listed here.
Example:
rules.general_rule.exclude_items=minecraft:elytraType: 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/chestplatesType: 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_groupType: comma-separated damage type ids
The rule only matches if the damage source id is listed here.
Examples:
minecraft:on_fireminecraft:dragon_breathminecraft:wither_skull
Type: comma-separated damage type ids
The rule will not match those damage types.
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_fireminecraft:is_explosion
Type: comma-separated damage type tag ids
The rule will not match damage sources that have any listed tag.
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.
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.
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
FLOORandminimum_damage=1, final result becomes1 - with
FLOORandminimum_damage=0, final result becomes0
Type:
FLOORROUNDCEIL
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.
For items:
- if
itemsanditem_tagsare both empty, the rule accepts any item - if either is filled, the item must match at least one of them
- if
exclude_itemsorexclude_item_tagsmatch, the rule is rejected
For damage:
- if
damage_typesanddamage_tagsare both empty, the rule accepts any damage - if either is filled, the damage source must match at least one of them
- if
exclude_damage_typesorexclude_damage_tagsmatch, the rule is rejected
In this version of the mod, the basic config is the actual default behavior.
The advanced config only contains custom rules listed in rules=....
It means:
- the rule still matches
- but vanilla durability behavior is used for that case
They mean "do not filter by this field".
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=