Enchantment
Link to enchantment
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 Copyimport crafttweaker.api.item.enchantment.Enchantment;
Metodi
Link to metodi
Name: canEnchant
Return Type: boolean
ZenScript CopyEnchantment.canEnchant(stack as ItemStack) as boolean
Parametro | Tipo |
---|---|
Parametro stack | Tipo ItemStack |
Name: doPostAttack
ZenScript CopyEnchantment.doPostAttack(source as LivingEntity, target as Entity, level as int)
Parametro | Tipo |
---|---|
Parametro sorgente | Tipo LivingEntity |
Parametro target | Tipo Entity |
Parametro level | Tipo int |
Name: doPostHurt
ZenScript CopyEnchantment.doPostHurt(source as LivingEntity, target as Entity, level as int)
Parametro | Tipo |
---|---|
Parametro sorgente | Tipo LivingEntity |
Parametro target | Tipo Entity |
Parametro level | Tipo int |
Name: getDamageBonus
Return Type: float
ZenScript CopyEnchantment.getDamageBonus(level as int, mobType as MobType) as float
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
Parametro mobType | Tipo MobType |
Name: getDamageProtection
Return Type: int
ZenScript CopyEnchantment.getDamageProtection(level as int, source as DamageSource) as int
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
Parametro sorgente | Tipo DamageSource |
Name: getDescriptionId
Return Type: string
ZenScript Copy// Enchantment.getDescriptionId() as string
myEnchantment.getDescriptionId();
Name: getFullname
Return Type: Component
ZenScript CopyEnchantment.getFullname(level as int) as Component
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
Name: getMaxCost
Return Type: int
ZenScript CopyEnchantment.getMaxCost(level as int) as int
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
Name: getMaxLevel
Return Type: int
ZenScript Copy// Enchantment.getMaxLevel() as int
myEnchantment.getMaxLevel();
Name: getMinCost
Return Type: int
ZenScript CopyEnchantment.getMinCost(level as int) as int
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
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 CopyEnchantment.getSlotItems(entity as LivingEntity) as ItemStack[EquipmentSlot]
Parametro | Tipo |
---|---|
Parametro entity | Tipo LivingEntity |
Name: isCompatibleWith
Return Type: boolean
ZenScript CopyEnchantment.isCompatibleWith(other as Enchantment) as boolean
Parametro | Tipo |
---|---|
Parametro other | Tipo Enchantment |
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();
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter |
---|---|---|---|
Nome commandString | Tipo string | Ha Getter sì | Ha Setter no |
Nome descriptionId | Tipo string | Ha Getter sì | Ha Setter no |
Nome isCurse | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isDiscoverable | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isTradeable | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isTreasureOnly | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome maxLevel | Tipo int | Ha Getter sì | Ha Setter no |
Nome minLevel | Tipo int | Ha Getter sì | Ha Setter no |
Nome rarity | Tipo Rarity | Ha Getter sì | Ha Setter no |