Attributes

Attributes

The Attributes section is a declarative shorthand for applying item attribute modifiers without writing full skill line syntax. Each entry generates a pair of synthetic skill lines — one on ~onEnchant to apply the modifier, and one on ~onEnchantRemove to clean it up — equivalent to using enchantitemattribute manually in Skills.

Attribute modifiers are written directly onto the item's metadata, so they persist across sessions, appear in the item tooltip, and stack correctly with the item's base attributes.

Syntax

example_enchant:
  Display: "<yellow>Example Enchant"
  Attributes:
    <SlotGroup>:
      - <ATTRIBUTE> <AMOUNT> [OPERATION]

Each line under a slot group follows this format:

Part Required Description
ATTRIBUTE Yes The attribute name (see Attributes)
AMOUNT Yes A numeric value or <math:> expression
OPERATION No The modifier operation (see Operations). Defaults to ADD_NUMBER

Example

example_enchant:
  Display: "<yellow>Example Enchant"
  Attributes:
    MainHand:
      - MAX_HEALTH 4
      - ATTACK_DAMAGE 2 ADD_NUMBER
      - ATTACK_DAMAGE <math:enchant_level*0.5> ADD_NUMBER
    Any:
      - ARMOR 2
      - ARMOR_TOUGHNESS 1 ADD_NUMBER

Slot Groups

The slot group key determines which equipment slot the attribute modifier is active in. Accepts any valid EquipmentSlotGroup name (case-insensitive).

Key Description
MainHand Active when held in the main hand
OffHand Active when held in the off hand
Head Active when worn on the head
Chest Active when worn on the chest
Legs Active when worn on the legs
Feet Active when worn on the feet
Armor Active in any armor slot
Any Active in any slot

Attribute Names

Attributes are resolved against the Minecraft attribute registry. Both the full namespaced form and bare shorthand are accepted. The generic_ prefix is stripped automatically, so generic_max_health, max_health, and minecraft:generic.max_health all resolve to the same attribute.

Common attributes:

Name Description
MAX_HEALTH Maximum health points
ATTACK_DAMAGE Melee attack damage
ATTACK_SPEED Attack speed
ATTACK_KNOCKBACK Knockback applied on hit
ARMOR Armor points
ARMOR_TOUGHNESS Armor toughness
KNOCKBACK_RESISTANCE Resistance to knockback
MOVEMENT_SPEED Movement speed
FLYING_SPEED Flying speed
BLOCK_BREAK_SPEED Block breaking speed
LUCK Luck

Any attribute registered in the Minecraft attribute registry can be used. Use the full namespace:key form for modded or non-generic attributes.


Operations

Controls how the amount is applied to the base attribute value.

Operation Aliases Description
ADD_NUMBER ADD, FLAT, BASE Adds a flat value to the base
ADD_SCALAR SCALAR, PERCENT, PERCENT_BASE Multiplies the base by (1 + amount)
MULTIPLY_SCALAR_1 MULTIPLY, PERCENT_TOTAL Multiplies the total (after all additions) by (1 + amount)

Defaults to ADD_NUMBER if omitted.


Math Expressions

The AMOUNT field supports <math:> expressions, allowing level-scaling modifiers.

  Attributes:
    MainHand:
      - ATTACK_DAMAGE <math:enchant_level*1.5> ADD_NUMBER
      - MAX_HEALTH <math:enchant_level*2> ADD_NUMBER

All standard enchantment variables are available: enchant_level, enchant_maxlevel, etc.


Notes

  • Modifiers are written into the item metadata and visible in the tooltip.
  • If the item already has a base modifier for the same attribute, operation, and slot group (e.g. a sword's default attack damage), the Attributes system will absorb and combine it rather than duplicating it, then restore the original on removal.
  • Attributes generates enchantitemattribute skill lines internally. For more advanced control — such as targeting a specific item slot, using SET vs ADD mode, or custom modifier keys — use enchantitemattribute directly in Skills instead.
Updated Aug 19, 2026