Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

EnchantmentCategory

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.item.enchantment.EnchantmentCategory;

Implements

Undocumented Interfaces

IExtensibleEnum,Comparable<Enum>

Enum Constants

EnchantmentCategory is an enum with 14 constants. They are accessible like so:

script.zs
// EnchantmentCategory.ARMOR
<constant:minecraft:enchantment/category:armor>
// EnchantmentCategory.ARMOR_CHEST
<constant:minecraft:enchantment/category:armor_chest>
// EnchantmentCategory.ARMOR_FEET
<constant:minecraft:enchantment/category:armor_feet>
// EnchantmentCategory.ARMOR_HEAD
<constant:minecraft:enchantment/category:armor_head>
// EnchantmentCategory.ARMOR_LEGS
<constant:minecraft:enchantment/category:armor_legs>
// EnchantmentCategory.BOW
<constant:minecraft:enchantment/category:bow>
// EnchantmentCategory.BREAKABLE
<constant:minecraft:enchantment/category:breakable>
// EnchantmentCategory.CROSSBOW
<constant:minecraft:enchantment/category:crossbow>
// EnchantmentCategory.DIGGER
<constant:minecraft:enchantment/category:digger>
// EnchantmentCategory.FISHING_ROD
<constant:minecraft:enchantment/category:fishing_rod>
// EnchantmentCategory.TRIDENT
<constant:minecraft:enchantment/category:trident>
// EnchantmentCategory.VANISHABLE
<constant:minecraft:enchantment/category:vanishable>
// EnchantmentCategory.WEAPON
<constant:minecraft:enchantment/category:weapon>
// EnchantmentCategory.WEARABLE
<constant:minecraft:enchantment/category:wearable>

Members

canEnchant(item as Item) as bool
script.zs
// EnchantmentCategory.canEnchant(item as Item) as bool;
<constant:minecraft:enchantment/category:armor>.canEnchant(myItem);

Parameters:

Return Type: bool