ItemEnchantments

Link to itemenchantments

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

Name: empty

Return Type: ItemEnchantments

ZenScript
Copy
// ItemEnchantments.empty() as ItemEnchantments

ItemEnchantments.empty();

Name: getLevel

Return Type: int

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

Name: withTooltip

Return Type: ItemEnchantments

ZenScript
Copy
ItemEnchantments.withTooltip(withTooltip as boolean) as ItemEnchantments
ParameterType
Parameter
withTooltip
Type
boolean
NameTypeHas GetterHas Setter
Name
entries
Type
int?[Enchantment]
Has Getter
true
Has Setter
false
Name
isEmpty
Type
boolean
Has Getter
true
Has Setter
false
Name
keySet
Type
Set<Enchantment>
Has Getter
true
Has Setter
false
Name
size
Type
int
Has Getter
true
Has Setter
false