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.enchantment.EnchantmentType;

Extending Enum<EnchantmentType>

Link to extending-enumenchantmenttype

EnchantmentType extends Enum<EnchantmentType>. That means all methods available in Enum<EnchantmentType> are also available in EnchantmentType

Name: create

Creates a new EnchantmentType with the given name and given can enchantment predicate.

Returns: A new EnchantmentType with the given name and predicate.
Return Type: EnchantmentType

ZenScript
Copy
EnchantmentType.create(name as string, canEnchantPredicate as Predicate<MCItemDefinition>) as EnchantmentType
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the new EnchantmentType.
Parameter
canEnchantPredicate
Type
Predicate<MCItemDefinition>
Description
The can enchant predicate.

Static Properties

Link to static-properties

NameTypeHas GetterHas SetterDescription
Name
ARMOR
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
ARMOR_CHEST
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
ARMOR_FEET
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
ARMOR_HEAD
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
ARMOR_LEGS
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
BOW
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
BREAKABLE
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
CROSSBOW
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
DIGGER
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
FISHING_ROD
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
TRIDENT
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
VANISHABLE
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
WEAPON
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
WEARABLE
Type
EnchantmentType
Has Getter
true
Has Setter
false
Description
No Description Provided

Name: canEnchantItem

Checks if the given Item can be enchanted with this EnchantmentType

Returns: True if the Item can be enchanted. False otherwise.
Return Type: boolean

ZenScript
Copy
EnchantmentType.canEnchantItem(itemIn as MCItemDefinition) as boolean
ParameterTypeDescription
Parameter
itemIn
Type
MCItemDefinition
Description
No Description Provided