EnchantmentCategory
Link to enchantmentcategory
导入类
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.item.enchantment.EnchantmentCategory;
Enum Constants
Link to enum-constants
EnchantmentCategory is an enum. It has 14 enum constants. They are accessible using the code below.
ZenScript Copy<constant:minecraft:enchantment/category:armor>
<constant:minecraft:enchantment/category:armor_feet>
<constant:minecraft:enchantment/category:armor_legs>
<constant:minecraft:enchantment/category:armor_chest>
<constant:minecraft:enchantment/category:armor_head>
<constant:minecraft:enchantment/category:weapon>
<constant:minecraft:enchantment/category:digger>
<constant:minecraft:enchantment/category:fishing_rod>
<constant:minecraft:enchantment/category:trident>
<constant:minecraft:enchantment/category:breakable>
<constant:minecraft:enchantment/category:bow>
<constant:minecraft:enchantment/category:wearable>
<constant:minecraft:enchantment/category:crossbow>
<constant:minecraft:enchantment/category:vanishable>
使用方式
Link to 使用方式
Name: canEnchant
Return Type: boolean
ZenScript CopyEnchantmentCategory.canEnchant(item as ItemDefinition) as boolean
参数 | 类型 |
---|---|
参数 item | 类型 ItemDefinition |