EnchantmentType
Link to enchantmenttype
导入类
Link to 导入类
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.enchantment.EnchantmentType;
Enum Constants
Link to enum-constants
EnchantmentType is an enum. It has 14 enum constants. They are accessible using the code below.
ZenScript CopyEnchantmentType.ARMOR
EnchantmentType.ARMOR_FEET
EnchantmentType.ARMOR_LEGS
EnchantmentType.ARMOR_CHEST
EnchantmentType.ARMOR_HEAD
EnchantmentType.WEAPON
EnchantmentType.DIGGER
EnchantmentType.FISHING_ROD
EnchantmentType.TRIDENT
EnchantmentType.BREAKABLE
EnchantmentType.BOW
EnchantmentType.WEARABLE
EnchantmentType.CROSSBOW
EnchantmentType.VANISHABLE
Static Methods
Link to static-methods
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 CopyEnchantmentType.create(name as string, canEnchantPredicate as Predicate<MCItemDefinition>) as EnchantmentType
参数 | 类型 | 描述 |
---|---|---|
参数 name(名称) | 类型 string | 描述 The name of the new EnchantmentType. |
参数 canEnchantPredicate | 类型 Predicate<MCItemDefinition> | 描述 The can enchant predicate. |
使用方式
Link to 使用方式
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 CopyEnchantmentType.canEnchantItem(itemIn as MCItemDefinition) as boolean
参数 | 类型 | 描述 |
---|---|---|
参数 itemIn | 类型 MCItemDefinition | 描述 No Description Provided |