Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

IEnchantment

An IEnchantment essentially is an IEnchantmentDefinition and an enchantment level.

Importing the package

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.
import crafttweaker.enchantments.IEnchantment;

ZenGetters/ZenSetters

ZenGetterZenSetterType
ZenGetter
definition
ZenSetter
Type
IEnchantmentDefinition
ZenGetter
level
ZenSetter
Type
int
ZenGetter
displayName
ZenSetter
displayName
Type
string

ZenMethods

Retrieve the Enchantment as NBT

You might want to get the Enchantment’s NBT-Tag.
You can either cast it as IData or use the method:

script.zs
ench.makeTag();
ench as crafttweaker.data.IData;