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

EnchantmentCost

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.EnchantmentCost;

Members

Getter
script.zs
// Cost.base as int
myCost.base

Return Type: int

calculate(level as int) as int
script.zs
// Cost.calculate(level as int) as int;
myCost.calculate(myInt);

Parameters:

level Type: int

Return Type: int

Getter
script.zs
// Cost.perLevelAboveFirst as int
myCost.perLevelAboveFirst

Return Type: int