Abilities

Abilities

Better Trims provides many built-in abilities of varying types.

Count Based Values

A lot of the abilities use "count-based values". These are values that scale based on the number of matching trims the player is wearing. See Count Based Values for more information.

Ability Types

Value Abilities

Abilities that modify the numerical value of a specific ability component. I.e. Incoming Damage, Trade Offer Costs, etc.

Add Value

{
"type": "bettertrims:add",
"value": <count-based-value>
}

Multiply Value

{
"type": "bettertrims:multiply",
"value": <count-based-value>
}

Set Value

{
"type": "bettertrims:set",
"value": <count-based-value>
}

Remove Binomial

Chance to subtract the value provided by the component by 1, based on a binomial distribution.

{
"type": "bettertrims:remove_binomial",
"chance": <count-based-value>
}

All Of

Combines multiple value abilities together. The abilities are applied in the order they are listed and the result of one ability is passed to the next.

{
"type": "bettertrims:all_of",
"abilities": [
{
"type": "<value_ability_type>",
// Ability specific fields here
},
{
"type": "<value_ability_type>",
// Ability specific fields here
}
]
}

Event Abilities

Abilities that trigger on specific events, such as after attacking, when the game ticks, when hitting a block, etc.

Apply Status Effect

{
"type": "bettertrims:apply_mob_effect",
"effect": "<namespace>:<effect_id>",
"duration": <count-based-value>,
"amplifier": <count-based-value>
}
FieldTypeRequiredDescription
effectstringYesThe ID of the status effect to apply (see Status Effect).
durationcount-based-valueYesThe duration of the effect in seconds.
amplifiercount-based-valueYesThe amplifier level of the effect (0 for level 1, 1 for level 2, etc.).

Change Item Damage

{
"type": "bettertrims:change_item_damage",
"amount": <count-based-value>
}
FieldTypeRequiredDescription
amountcount-based-valueYesThe amount to change the item's damage by (negative to repair).

Damage Entity

Deals between min_damage and max_damage damage of damage_type to the entity in context.

{
"type": "bettertrims:damage_entity",
"min_damage": <count-based-value>,
"max_damage": <count-based-value>,
"damage_type": "<namespace>:<damage_type_id>"
}
FieldTypeRequiredDescription
min_damagecount-based-valueYesThe minimum amount of damage to deal.
max_damagecount-based-valueYesThe maximum amount of damage to deal.
damage_typestringYesThe type of damage to deal (see Damage Type).

Explode

{
"type": "bettertrims:explode",
"attribute_to_wearer": <boolean>,
"damage_type": "<namespace>:<damage_type_id>",
"knockback_multiplier": <count-based-value>,
"immune_blocks": "#<namespace>:<tag_id>",
"offset": <vector>,
"radius": <count-based-value>,
"create_fire": <boolean>,
"block_interaction": "<block_interaction_type>"
"small_particle": "<namespace>:<particle_type_id>",
"large_particle": "<namespace>:<particle_type_id>",
"sound": "<namespace>:<sound_event_id>"
}
FieldTypeRequiredDescription
attribute_to_wearerbooleanNoWhether the explosion should be attributed to the wearer. Defaults to false.
damage_typestringNoThe type of damage to deal (see Damage Type). If not provided, the explosion will not deal damage.
knockback_multipliercount-based-valueNoThe multiplier for knockback applied by the explosion. Defaults to 1.0.
immune_blocksstringNoA tag of blocks that the explosion will not destroy regardless of the explosion's strength.
offsetvectorNoThe offset from the context position to create the explosion at. Defaults to (0, 0, 0).
radiuscount-based-valueYesThe radius of the explosion.
create_firebooleanNoWhether the explosion should create fire. Defaults to false.
block_interactionstringYesHow the explosion should interact with blocks. One of none (no effect), block (like a bed explosion), mob (like a creeper explosion), tnt (like tnt explosion), trigger (like a wind-charge explosion).
small_particlestringYesThe small particles in the explosion effect (see Particles).
large_particlestringYesThe large particles in the explosion effect (see Particles).
soundstringYesThe sound to play when the explosion occurs.

Ignite

{
"type": "bettertrims:ignite",
"duration": <count-based-value>
}
FieldTypeRequiredDescription
durationcount-based-valueYesThe duration to set the entity on fire for, in seconds.

Play Sound

{
"type": "bettertrims:play_sound",
"sound": "<namespace>:<sound_event_id>",
"volume": <float-provider>,
"pitch": <float-provider>
}
FieldTypeRequiredDescription
soundstringYesThe sound event to play.
volumefloat-providerYesThe volume of the sound (see Float Provider).
pitchfloat-providerYesThe pitch of the sound (see Float Provider).

Replace Block

{
"type": "bettertrims:replace_block",
"offset": <vector>,
"predicate": <block-predicate>,
"block_state": <block-state-provider>
"trigger_game_event": "<namespace>:<game_event_id>",
"replace_translation_key": "<lang_key>"
"offset_translation_key": "<lang_key>"
"with_translation_key": "<lang_key>"
}
FieldTypeRequiredDescription
offsetvectorNoThe offset from the context position to replace the block at. Defaults to (0, 0, 0).
predicateblock-predicateNoA predicate that the block to replace must match. If not provided, any block can be replaced (see Block Predicate).
block_stateblock-state-providerYesThe block state to replace the block with (see Block State Provider).
trigger_game_eventstringNoA game event to trigger at the position of the replaced block (see Game Event).
replace_translation_keystringNoA translation key for the replaced block to use in the ability tooltip. Eg. "Lit Redstone Lamp"
offset_translation_keystringNoA translation key for the offset to use in the ability tooltip. Eg. "Below"
with_translation_keystringNoA translation key for the new block state to use in the ability tooltip. Eg. "Glowstone"

Replace Disk

{
"type": "bettertrims:replace_disk",
"radius": <count-based-value>,
"height": <count-based-value>,
"offset": <vector>,
"predicate": <block-predicate>,
"block_state": <block-state-provider>
"replace_translation_key": "<lang_key>"
"offset_translation_key": "<lang_key>"
"with_translation_key": "<lang_key>"
}
FieldTypeRequiredDescription
radiuscount-based-valueYesThe radius of the disk to replace blocks in.
heightcount-based-valueYesThe height of the disk to replace blocks in.
offsetvectorNoThe offset from the context position to replace the block at. Defaults to (0, 0, 0).
predicateblock-predicateNoA predicate that the block to replace must match. If not provided, any block can be replaced (see Block Predicate).
block_stateblock-state-providerYesThe block state to replace the block with (see Block State Provider).
trigger_game_eventstringNoA game event to trigger at the position of the replaced block (see Game Event).
replace_translation_keystringNoA translation key for the replaced block to use in the ability tooltip. Eg. "Lit Redstone Lamp"
offset_translation_keystringNoA translation key for the offset to use in the ability tooltip. Eg. "Below"
with_translation_keystringNoA translation key for the new block state to use in the ability tooltip. Eg. "Glowstone"

Run Function

{
"type": "bettertrims:run_function",
"function": "<namespace>:<function_id>",
"tooltip_translation_key": "<lang_key>"
}
FieldTypeRequiredDescription
functionstringYesThe ID of the function to run.
tooltip_translation_keystringYesA translation key for the ability tooltip to describe the function being run.

Set Block Properties

{
"type": "bettertrims:set_block_properties",
"properties": {
"<property_name>": "<property_value>",
...
},
"offset": <vector>,
"trigger_game_event": "<namespace>:<game_event_id>",
"properties_translation_key": "<lang_key>"
"offset_translation_key": "<lang_key>"
}
FieldTypeRequiredDescription
propertiesobjectYesThe block properties to set on the block (see Block States).
offsetvectorNoThe offset from the context position to set the block properties at. Defaults to (0, 0, 0).
trigger_game_eventstringNoA game event to trigger at the position of the block (see Game Event).
properties_translation_keystringYesA translation key for the block properties to use in the ability tooltip. Eg. "Facing North, Lit"
offset_translation_keystringYesA translation key for the offset to use in the ability tooltip. Eg. "Below"

Spawn Particles

{
"type": "bettertrims:spawn_particles",
"particle": "<namespace>:<particle_type_id>",
"horizontal_position": <position-source>,
"vertical_position": <position-source>,
"horizontal_velocity": <velocity-source>,
"vertical_velocity": <velocity-source>
"speed": <float-provider>
}
FieldTypeRequiredDescription
particlestringYesThe particle type to spawn (see Particles).
horizontal_positionposition-sourceYesThe source for the horizontal position to spawn the particles at (see below).
vertical_positionposition-sourceYesThe source for the vertical position to spawn the particles at (see below).
horizontal_velocityvelocity-sourceYesThe source for the horizontal velocity of the spawned particles (see below).
vertical_velocityvelocity-sourceYesThe source for the vertical velocity of the spawned particles (see below).
speedfloat-providerYesThe speed of the spawned particles (see Float Provider).

Position Source:

{
"type": "<position_source_type>",
"offset": <float>,
"scale": <float>
}
FieldTypeRequiredDescription
typestringYesOne of entity_position (spawn at position of entity) or in_bounding_box (spawn at random position inside the bounding box of the entity)
offsetfloatNoAn offset to add to the position. Defaults to 0.
scalefloatNoA scale to multiply the in_bounding_box random position by. Defaults to 1. Only used if type is in_bounding_box.

Velocity Source:

{
"base": <float-provider>,
"movement_scale": <float>
}
FieldTypeRequiredDescription
basefloat-providerNoA base velocity to add to the particle. Defaults to 0. (see Float Provider).
movement_scalefloatNoA scale to multiply the entity's movement by and add to the particle's velocity. Defaults to 1.

Summon Entity

{
"type": "bettertrims:summon_entity",
"entity": "<namespace>:<entity_id>"
}
FieldTypeRequiredDescription
entitystringYesThe ID of the entity to summon.

All Of

Combines multiple event abilities together. The abilities are applied in the order they are listed.

{
"type": "bettertrims:all_of",
"abilities": [
{
"type": "<event_ability_type>",
// Ability specific fields here
},
{
"type": "<event_ability_type>",
// Ability specific fields here
}
]
}

Toggle Abilities

Abilities that are active while the property is equipped, this is mostly useful for attribute modifiers.

Attribute

{
"type": "bettertrims:attribute",
"attribute": "<namespace>:<attribute_id>",
"value": <count-based-value>,
"operation": "<operation_type>"
}
FieldTypeRequiredDescription
attributestringYesThe ID of the attribute to modify (see Attribute).
valuecount-based-valueYesThe value to modify the attribute by.
operationstringYesThe operation to perform (see Operation).

Toggle Status Effect

{
"type": "bettertrims:toggle_mob_effect",
"effect": "<namespace>:<effect_id>",
"amplifier": <count-based-value>,
"visible": <boolean>
}
FieldTypeRequiredDescription
effectstringYesThe ID of the status effect to apply (see Status Effect).
amplifiercount-based-valueYesThe amplifier level of the effect (0 for level 1, 1 for level 2, etc.).
visiblebooleanNoWhether the effect should be visible on the player (particles and icon). Defaults to true.

All Of

Combines multiple toggle abilities together. The abilities are applied in the order they are listed.

{
"type": "bettertrims:all_of",
"abilities": [
{
"type": "<toggle_ability_type>",
// Ability specific fields here
},
{
"type": "<toggle_ability_type>",
// Ability specific fields here
}
]
}

Flag Abilities

Abilities that toggle a boolean flag, such as Damage Immunity or Piglin Safety do not require any additional parameters.
Flag abilities are simply defined by the component type:

{
"bettertrims:piglin_safe": [
{
"ability": {}
}
]
}