ItemEnchantmentsMutable

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.item.component.ItemEnchantmentsMutable;

Members

getLevel(enchantment as Enchantment) as int
script.zs
// Mutable.getLevel(enchantment as Enchantment) as int;
myMutable.getLevel(myEnchantment);

Parameters:

enchantment Type: Enchantment

Return Type: int

Getter
script.zs
// Mutable.keySet as Set<Enchantment>
myMutable.keySet

Return Type: Set<Enchantment>

static of(enchantments as ItemEnchantments = null) as Mutable
script.zs
// Mutable.of(enchantments as ItemEnchantments = null) as ItemEnchantmentsMutable;
ItemEnchantmentsMutable.of(myItemEnchantments);

Parameters:

enchantments (optional) Type: ItemEnchantments

Default Value: null

Return Type: ItemEnchantmentsMutable

removeIf(predicate as function(t as Enchantment) as bool)
script.zs
// Mutable.removeIf(predicate as function(t as Enchantment) as bool);
myMutable.removeIf(myPredicate);

Parameters:

predicate Type: function(t as Enchantment) as bool
setEnchantment(enchantment as Enchantment, level as int)
script.zs
// Mutable.setEnchantment(enchantment as Enchantment, level as int);
myMutable.setEnchantment(myEnchantment, myInt);

Parameters:

enchantment Type: Enchantment
level Type: int
toImmutable() as ItemEnchantments
script.zs
// Mutable.toImmutable() as ItemEnchantments;
myMutable.toImmutable();

Return Type: ItemEnchantments

upgrade(enchantment as Enchantment, level as int)
script.zs
// Mutable.upgrade(enchantment as Enchantment, level as int);
myMutable.upgrade(myEnchantment, myInt);

Parameters:

enchantment Type: Enchantment
level Type: int