Importare la Classe

Link to importare-la-classe

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
Copy
import crafttweaker.api.item.enchantment.Enchantment;

Name: canEnchant

Return Type: boolean

ZenScript
Copy
Enchantment.canEnchant(stack as ItemStack) as boolean
ParametroTipoDescrizione
Parametro
stack
Tipo
ItemStack
Descrizione
No Description Provided

Name: doPostAttack

Return Type: void

ZenScript
Copy
Enchantment.doPostAttack(source as LivingEntity, target as Entity, level as int) as void
ParametroTipoDescrizione
Parametro
sorgente
Tipo
LivingEntity
Descrizione
No Description Provided
Parametro
target
Tipo
Entity
Descrizione
No Description Provided
Parametro
level
Tipo
int
Descrizione
No Description Provided

Name: doPostHurt

Return Type: void

ZenScript
Copy
Enchantment.doPostHurt(source as LivingEntity, target as Entity, level as int) as void
ParametroTipoDescrizione
Parametro
sorgente
Tipo
LivingEntity
Descrizione
No Description Provided
Parametro
target
Tipo
Entity
Descrizione
No Description Provided
Parametro
level
Tipo
int
Descrizione
No Description Provided

Name: getDamageBonus

Return Type: float

ZenScript
Copy
Enchantment.getDamageBonus(level as int, mobType as MobType) as float
ParametroTipoDescrizione
Parametro
level
Tipo
int
Descrizione
No Description Provided
Parametro
mobType
Tipo
MobType
Descrizione
No Description Provided

Link to getDamageProtection

Name: getDamageProtection

Return Type: int

ZenScript
Copy
Enchantment.getDamageProtection(level as int, source as DamageSource) as int
ParametroTipoDescrizione
Parametro
level
Tipo
int
Descrizione
No Description Provided
Parametro
sorgente
Tipo
DamageSource
Descrizione
No Description Provided

Link to getDescriptionId

Name: getDescriptionId

Return Type: string

ZenScript
Copy
// Enchantment.getDescriptionId() as string

myEnchantment.getDescriptionId();

Name: getFullname

Return Type: Component

ZenScript
Copy
Enchantment.getFullname(level as int) as Component
ParametroTipoDescrizione
Parametro
level
Tipo
int
Descrizione
No Description Provided

Name: getMaxCost

Return Type: int

ZenScript
Copy
Enchantment.getMaxCost(level as int) as int
ParametroTipoDescrizione
Parametro
level
Tipo
int
Descrizione
No Description Provided

Name: getMaxLevel

Return Type: int

ZenScript
Copy
// Enchantment.getMaxLevel() as int

myEnchantment.getMaxLevel();

Name: getMinCost

Return Type: int

ZenScript
Copy
Enchantment.getMinCost(level as int) as int
ParametroTipoDescrizione
Parametro
level
Tipo
int
Descrizione
No Description Provided

Name: getMinLevel

Return Type: int

ZenScript
Copy
// Enchantment.getMinLevel() as int

myEnchantment.getMinLevel();

Name: getRarity

Return Type: Rarity

ZenScript
Copy
// Enchantment.getRarity() as Rarity

myEnchantment.getRarity();

Name: getSlotItems

Return Type: ItemStack[EquipmentSlot]

ZenScript
Copy
Enchantment.getSlotItems(entity as LivingEntity) as ItemStack[EquipmentSlot]
ParametroTipoDescrizione
Parametro
entity
Tipo
LivingEntity
Descrizione
No Description Provided

Link to isCompatibleWith

Name: isCompatibleWith

Return Type: boolean

ZenScript
Copy
Enchantment.isCompatibleWith(other as Enchantment) as boolean
ParametroTipoDescrizione
Parametro
other
Tipo
Enchantment
Descrizione
No Description Provided

Name: isCurse

Return Type: boolean

ZenScript
Copy
// Enchantment.isCurse() as boolean

myEnchantment.isCurse();

Name: isDiscoverable

Return Type: boolean

ZenScript
Copy
// Enchantment.isDiscoverable() as boolean

myEnchantment.isDiscoverable();

Name: isTradeable

Return Type: boolean

ZenScript
Copy
// Enchantment.isTradeable() as boolean

myEnchantment.isTradeable();

Name: isTreasureOnly

Return Type: boolean

ZenScript
Copy
// Enchantment.isTreasureOnly() as boolean

myEnchantment.isTreasureOnly();
NomeTipoHa GetterHa SetterDescrizione
Nome
commandString
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
descriptionId
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
isCurse
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
isDiscoverable
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
isTradeable
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
isTreasureOnly
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
maxLevel
Tipo
int
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
minLevel
Tipo
int
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
rarity
Tipo
Rarity
Ha Getter
Ha Setter
no
Descrizione
No Description Provided