ItemEnchantmentsMutable

Link to itemenchantmentsmutable

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.ItemEnchantmentsMutable;

Name: getLevel

Return Type: int

ZenScript
Copy
ItemEnchantmentsMutable.getLevel(enchantment as Enchantment) as int
ParameterType
Parameter
enchantment
Type
Enchantment

Name: of

Return Type: ItemEnchantmentsMutable

ZenScript
Copy
ItemEnchantmentsMutable.of(enchantments as ItemEnchantments) as ItemEnchantmentsMutable
ParameterTypeOptional
Parameter
enchantments
Type
ItemEnchantments
Optional
true

Name: removeIf

ZenScript
Copy
ItemEnchantmentsMutable.removeIf(predicate as Predicate<Enchantment>)
ParameterType
Parameter
predicate
Type
Predicate<Enchantment>

Name: setEnchantment

ZenScript
Copy
ItemEnchantmentsMutable.setEnchantment(enchantment as Enchantment, level as int)
ParameterType
Parameter
enchantment
Type
Enchantment
Parameter
level
Type
int

Name: toImmutable

Return Type: ItemEnchantments

ZenScript
Copy
// ItemEnchantmentsMutable.toImmutable() as ItemEnchantments

myItemEnchantmentsMutable.toImmutable();

Name: upgrade

ZenScript
Copy
ItemEnchantmentsMutable.upgrade(enchantment as Enchantment, level as int)
ParameterType
Parameter
enchantment
Type
Enchantment
Parameter
level
Type
int
NameTypeHas GetterHas Setter
Name
keySet
Type
Set<Enchantment>
Has Getter
true
Has Setter
false