Skip to content

ItemAttributeModifierHelper ​

com.jsmacrosce.jsmacros.client.api.helper.inventory.ItemAttributeModifierHelper

Since2.3.0

Describes one configured item attribute modifier and where it applies.

js
const modifiers = Player.getPlayer()?.getMainHand().getComponents().getAttributeModifiers();  
if (modifiers != null) {
  for (const modifier of modifiers) {
    Chat.log(`${modifier.getAttributeId()}: ${modifier.getOperation()} ${modifier.getAmount()}`);  
  }
}

Methods ​

getAmount ​

getAmount(): double#
Returns: the modifier amount, interpreted according to its operation

getAttributeId ​

getAttributeId(): String#
Returns: the attribute's registry ID, or "[unregistered]" for an inline attribute

getModifierId ​

getModifierId(): String#
Returns: this modifier's ID, separate from the attribute it changes

getOperation ​

getOperation(): String#
Returns: the operation name, such as "add_value" or "add_multiplied_base"

getSlotGroup ​

getSlotGroup(): String#
Returns: the equipment slot group name, such as "mainhand" or "armor"