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

Enchantment

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

Implements

Undocumented Interfaces

IEnchantmentExtension

Members

canEnchant(stack as ItemStack) as bool
script.zs
// Enchantment.canEnchant(stack as ItemStack) as bool;
myEnchantment.canEnchant(myItemStack);

Parameters:

stack Type: ItemStack

Return Type: bool

Getter
script.zs
// Enchantment.commandString as string
myEnchantment.commandString

Return Type: string

Getter
script.zs
// Enchantment.descriptionId as string
myEnchantment.descriptionId

Return Type: string

descriptionId() as string
script.zs
// Enchantment.descriptionId() as string;
myEnchantment.descriptionId();

Return Type: string

doPostAttack(source as LivingEntity, target as Entity, level as int)
script.zs
// Enchantment.doPostAttack(source as LivingEntity, target as Entity, level as int);
myEnchantment.doPostAttack(myLivingEntity, myEntity, myInt);

Parameters:

source Type: LivingEntity
target Type: Entity
level Type: int
doPostHurt(source as LivingEntity, target as Entity, level as int)
script.zs
// Enchantment.doPostHurt(source as LivingEntity, target as Entity, level as int);
myEnchantment.doPostHurt(myLivingEntity, myEntity, myInt);

Parameters:

source Type: LivingEntity
target Type: Entity
level Type: int
getDamageBonus(level as int, mobType as MobType) as float
script.zs
// Enchantment.getDamageBonus(level as int, mobType as MobType) as float;
myEnchantment.getDamageBonus(myInt, myMobType);

Parameters:

level Type: int
mobType Type: MobType

Return Type: float

getDamageProtection(level as int, source as DamageSource) as int
script.zs
// Enchantment.getDamageProtection(level as int, source as DamageSource) as int;
myEnchantment.getDamageProtection(myInt, myDamageSource);

Parameters:

level Type: int
source Type: DamageSource

Return Type: int

getFullname(level as int) as Component
script.zs
// Enchantment.getFullname(level as int) as Component;
myEnchantment.getFullname(myInt);

Parameters:

level Type: int

Return Type: Component

getMaxCost(level as int) as int
script.zs
// Enchantment.getMaxCost(level as int) as int;
myEnchantment.getMaxCost(myInt);

Parameters:

level Type: int

Return Type: int

getMinCost(level as int) as int
script.zs
// Enchantment.getMinCost(level as int) as int;
myEnchantment.getMinCost(myInt);

Parameters:

level Type: int

Return Type: int

getSlotItems(entity as LivingEntity) as ItemStack[EquipmentSlot]
script.zs
// Enchantment.getSlotItems(entity as LivingEntity) as ItemStack[EquipmentSlot];
myEnchantment.getSlotItems(myLivingEntity);

Parameters:

entity Type: LivingEntity

Return Type: ItemStack[EquipmentSlot]

isCompatibleWith(other as Enchantment) as bool
script.zs
// Enchantment.isCompatibleWith(other as Enchantment) as bool;
myEnchantment.isCompatibleWith(myEnchantment);

Parameters:

other Type: Enchantment

Return Type: bool

Getter
script.zs
// Enchantment.isCurse as bool
myEnchantment.isCurse

Return Type: bool

isCurse() as bool
script.zs
// Enchantment.isCurse() as bool;
myEnchantment.isCurse();

Return Type: bool

Getter
script.zs
// Enchantment.isDiscoverable as bool
myEnchantment.isDiscoverable

Return Type: bool

isDiscoverable() as bool
script.zs
// Enchantment.isDiscoverable() as bool;
myEnchantment.isDiscoverable();

Return Type: bool

Getter
script.zs
// Enchantment.isTradeable as bool
myEnchantment.isTradeable

Return Type: bool

isTradeable() as bool
script.zs
// Enchantment.isTradeable() as bool;
myEnchantment.isTradeable();

Return Type: bool

Getter
script.zs
// Enchantment.isTreasureOnly as bool
myEnchantment.isTreasureOnly

Return Type: bool

isTreasureOnly() as bool
script.zs
// Enchantment.isTreasureOnly() as bool;
myEnchantment.isTreasureOnly();

Return Type: bool

Getter
script.zs
// Enchantment.maxLevel as int
myEnchantment.maxLevel

Return Type: int

maxLevel() as int
script.zs
// Enchantment.maxLevel() as int;
myEnchantment.maxLevel();

Return Type: int

Getter
script.zs
// Enchantment.minLevel as int
myEnchantment.minLevel

Return Type: int

minLevel() as int
script.zs
// Enchantment.minLevel() as int;
myEnchantment.minLevel();

Return Type: int

Getter
script.zs
// Enchantment.rarity as Rarity
myEnchantment.rarity

Return Type: Rarity

rarity() as Rarity
script.zs
// Enchantment.rarity() as Rarity;
myEnchantment.rarity();

Return Type: Rarity

Getter
script.zs
// Enchantment.registryName as ResourceLocation
myEnchantment.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
script.zs
// Enchantment.registryName() as ResourceLocation;
myEnchantment.registryName();

Return Type: ResourceLocation