Enchantment
Link to enchantment
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 Copyimport crafttweaker.api.item.enchantment.Enchantment;
Extending Record
Link to extending-record
Enchantment extends Record. That means all methods available in Record are also available in Enchantment
Methods
Link to methods
Name: canEnchant
Return Type: boolean
ZenScript CopyEnchantment.canEnchant(stack as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Name: getMaxCost
Return Type: int
ZenScript CopyEnchantment.getMaxCost(level as int) as int
Parameter | Type |
---|---|
Parameter level | Type int |
Name: getMinCost
Return Type: int
ZenScript CopyEnchantment.getMinCost(level as int) as int
Parameter | Type |
---|---|
Parameter level | Type int |
Name: getSlotItems
Return Type: IItemStack[EquipmentSlot]
ZenScript CopyEnchantment.getSlotItems(entity as LivingEntity) as IItemStack[EquipmentSlot]
Parameter | Type |
---|---|
Parameter entity | Type LivingEntity |
Name: isPrimaryItem
Return Type: boolean
ZenScript CopyEnchantment.isPrimaryItem(stack as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Name: isSupportedItem
Return Type: boolean
ZenScript CopyEnchantment.isSupportedItem(stack as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Name: matchingSlot
Return Type: boolean
ZenScript CopyEnchantment.matchingSlot(slot as EquipmentSlot) as boolean
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name | Type int | Has Getter true | Has Setter false |
Name anvilCost | Type int | Has Getter true | Has Setter false |
Name commandString | Type string | Has Getter true | Has Setter false |
Name definition | Type EnchantmentDefinition | Has Getter true | Has Setter false |
Name description | Type Component | Has Getter true | Has Setter false |
Name exclusiveSet | Type Enchantment[] | Has Getter true | Has Setter false |
Name minLevel | Type int | Has Getter true | Has Setter false |
Name registryName | Type ResourceLocation | Has Getter true | Has Setter false |
Name supportedItems | Type ItemDefinition[] | Has Getter true | Has Setter false |
Name weight | Type int | Has Getter true | Has Setter false |