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 Copyimport crafttweaker.api.item.component.ItemEnchantmentsMutable;
Static Methods
Link to static-methods
Name: of
Return Type: ItemEnchantmentsMutable
ZenScript CopyItemEnchantmentsMutable.of(enchantments as ItemEnchantments) as ItemEnchantmentsMutable
Parameter | Type | Optional |
---|---|---|
Parameter enchantments | Type ItemEnchantments | Optional true |
Methods
Link to methods
Name: getLevel
Return Type: int
ZenScript CopyItemEnchantmentsMutable.getLevel(enchantment as Enchantment) as int
Parameter | Type |
---|---|
Parameter enchantment | Type Enchantment |
Name: removeIf
ZenScript CopyItemEnchantmentsMutable.removeIf(predicate as Predicate<Enchantment>)
Parameter | Type |
---|---|
Parameter predicate | Type Predicate<Enchantment> |
Name: setEnchantment
ZenScript CopyItemEnchantmentsMutable.setEnchantment(enchantment as Enchantment, level as int)
Parameter | Type |
---|---|
Parameter enchantment | Type Enchantment |
Parameter level | Type int |
Name: toImmutable
Return Type: ItemEnchantments
ZenScript Copy// ItemEnchantmentsMutable.toImmutable() as ItemEnchantments
myItemEnchantmentsMutable.toImmutable();
Name: upgrade
ZenScript CopyItemEnchantmentsMutable.upgrade(enchantment as Enchantment, level as int)
Parameter | Type |
---|---|
Parameter enchantment | Type Enchantment |
Parameter level | Type int |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name keySet | Type Set<Enchantment> | Has Getter true | Has Setter false |