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

EnchantmentProvider

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.provider.EnchantmentProvider;

Members

enchant(stack as ItemStack, enchantments as Mutable, random as RandomSource, difficulty as DifficultyInstance)
script.zs
// EnchantmentProvider.enchant(stack as ItemStack, enchantments as ItemEnchantmentsMutable, random as RandomSource, difficulty as DifficultyInstance);
myEnchantmentProvider.enchant(myItemStack, myMutable, myRandomSource, myDifficultyInstance);

Parameters: