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.
import crafttweaker.api.item.component.ItemEnchantmentsMutable;
Members
getLevel(enchantment as Enchantment) as int
myMutable.getLevel(myEnchantment);
Parameters:
enchantment: Enchantment
Type: Enchantment
Return Type:
int
Getter
myMutable.keySet
Return Type:
Set<Enchantment>
of(enchantments as ItemEnchantments = null) as Mutable
removeIf(predicate as function(t as Enchantment) as bool)
myMutable.removeIf(myPredicate);
Parameters:
predicate: function(t as Enchantment) as bool
Type: function(t as Enchantment) as bool
setEnchantment(enchantment as Enchantment, level as int)
myMutable.setEnchantment(myEnchantment, myInt);
Parameters:
enchantment: Enchantment
Type: Enchantment
level: int
Type: int
toImmutable() as ItemEnchantments
upgrade(enchantment as Enchantment, level as int)
myMutable.upgrade(myEnchantment, myInt);
Parameters:
enchantment: Enchantment
Type: Enchantment
level: int
Type: int