Components

Components

Better Trims provides a variety of property components that can be used determine how a trim ability or item property behaves.

All components are optional, and each component can have multiple abilities or properties using it. Additionally, each ability or property can have optional requirements that must be met for it to activate.

See Abilities and Item Properties for more information on how to define abilities and item properties.

Structure

{
"abilities": {
"<ability_component>": [
{
"ability": {
"type": "<ability_type>",
// Ability specific fields here
},
"requirements": {
// Optional requirements that must be met for the ability to activate
}
}
],
"<ability_component_2>": [
...
],
...
},
"item_properties": {
"<item_property_component>": [
{
"item_property": {
"type": "<property_type>",
// Property specific fields here
},
"requirements": {
// Optional requirements that must be met for the property to activate
}
}
],
"<item_property_component_2>": [
...
],
...
}
}

Fields

FieldTypeRequiredDescription
<component>arrayNoThe component name. Each component can have multiple abilities or properties using it.
abilityobjectYesThe ability object defining the ability granted by the component.
item_propertyobjectYesThe item property object defining the item property granted by the component.
requirementsobjectNoOptional requirements that must be met for the ability or property to activate. See Requirements for more information.

Ability Components

Component NameTypeDescription
incoming_damagevalueModifies the amount of damage the wearer takes.
damage_immunityflagMakes the wearer immune to incoming damage.
damagevalueIncreases the damage dealt by the wearer.
armour_effectivenessvalueModifies the effectiveness of the target's armour.
post_attackeventRuns after the wearer attacks an entity.
hit_blockeventRuns when the wearer hits a block.
item_damagevalueModifies the amount of durability damage the item takes.
equippedtoggleActivate while the property is equipped.
tickeventRuns every tick while the property is active.
secondeventRuns every second while the property is active.
projectile_tickeventRuns every tick while a projectile fired by the wearer is in flight.
experience_gainedvalueModifies the amount of experience the wearer gains.
trade_costvalueModifies the cost of trades with villagers.
piglin_safeflagMakes the wearer safe from Piglin aggression.

Item Property Components

Component NameTypeDescription
damage_immunityflagMakes the item entity immune to damage.