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
Copy
import 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

Name: builder

Return Type: ItemAttributeModifiersBuilder

ZenScript
Copy
// ItemAttributeModifiers.builder() as ItemAttributeModifiersBuilder

ItemAttributeModifiers.builder();

Name: of

Return Type: ItemAttributeModifiers

ZenScript
Copy
ItemAttributeModifiers.of(modifiers as stdlib.List<ItemAttributeModifiersEntry>, showInTooltip as boolean) as ItemAttributeModifiers
ParameterType
Parameter
modifiers
Type
stdlib.List<ItemAttributeModifiersEntry>
Parameter
showInTooltip
Type
boolean

Name: compute

Return Type: double

ZenScript
Copy
ItemAttributeModifiers.compute(baseValue as double, slot as EquipmentSlot) as double
ParameterType
Parameter
baseValue
Type
double
Parameter
slot
Type
EquipmentSlot

Name: forEach

ZenScript
Copy
ItemAttributeModifiers.forEach(slot as EquipmentSlot, consumer as BiConsumer<Attribute,AttributeModifier>)
ParameterType
Parameter
slot
Type
EquipmentSlot
Parameter
consumer
Type
BiConsumer<Attribute,AttributeModifier>

Link to withModifierAdded

Name: withModifierAdded

Return Type: ItemAttributeModifiers

ZenScript
Copy
ItemAttributeModifiers.withModifierAdded(attribute as Attribute, modifier as AttributeModifier, slot as EquipmentSlotGroup) as ItemAttributeModifiers
ParameterType
Parameter
attribute
Type
Attribute
Parameter
modifier
Type
AttributeModifier
Parameter
slot
Type
EquipmentSlotGroup

Name: withTooltip

Return Type: ItemAttributeModifiers

ZenScript
Copy
ItemAttributeModifiers.withTooltip(showInTooltip as boolean) as ItemAttributeModifiers
ParameterType
Parameter
showInTooltip
Type
boolean
NameTypeHas GetterHas Setter
Name
modifiers
Type
stdlib.List<ItemAttributeModifiersEntry>
Has Getter
true
Has Setter
false
Name
showInTooltip
Type
boolean
Has Getter
true
Has Setter
false