ItemAttributeModifiers
Link to itemattributemodifiers
Importing the class
Link to importing-the-class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.item.component.ItemAttributeModifiers;
Extending Record
Link to extending-record
ItemAttributeModifiers extends Record. That means all methods available in Record are also available in ItemAttributeModifiers
Static Methods
Link to static-methods
Name: builder
Return Type: ItemAttributeModifiersBuilder
ZenScript Copy// ItemAttributeModifiers.builder() as ItemAttributeModifiersBuilder
ItemAttributeModifiers.builder();
Name: of
Return Type: ItemAttributeModifiers
ZenScript CopyItemAttributeModifiers.of(modifiers as stdlib.List<ItemAttributeModifiersEntry>, showInTooltip as boolean) as ItemAttributeModifiers
Parameter | Type |
---|---|
Parameter modifiers | Type stdlib.List<ItemAttributeModifiersEntry> |
Parameter showInTooltip | Type boolean |
Methods
Link to methods
Name: compute
Return Type: double
ZenScript CopyItemAttributeModifiers.compute(baseValue as double, slot as EquipmentSlot) as double
Parameter | Type |
---|---|
Parameter baseValue | Type double |
Parameter slot | Type EquipmentSlot |
Name: forEach
ZenScript CopyItemAttributeModifiers.forEach(slot as EquipmentSlot, consumer as BiConsumer<Attribute,AttributeModifier>)
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Parameter consumer | Type BiConsumer<Attribute,AttributeModifier> |
Name: withModifierAdded
Return Type: ItemAttributeModifiers
ZenScript CopyItemAttributeModifiers.withModifierAdded(attribute as Attribute, modifier as AttributeModifier, slot as EquipmentSlotGroup) as ItemAttributeModifiers
Parameter | Type |
---|---|
Parameter attribute | Type Attribute |
Parameter modifier | Type AttributeModifier |
Parameter slot | Type EquipmentSlotGroup |
Name: withTooltip
Return Type: ItemAttributeModifiers
ZenScript CopyItemAttributeModifiers.withTooltip(showInTooltip as boolean) as ItemAttributeModifiers
Parameter | Type |
---|---|
Parameter showInTooltip | Type boolean |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name modifiers | Type stdlib.List<ItemAttributeModifiersEntry> | Has Getter true | Has Setter false |
Name showInTooltip | Type boolean | Has Getter true | Has Setter false |