Enchantment
Link to enchantment
Importing the class
Link to importing-the-class
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;
Methods
Link to methods
Name: canEnchant
Return Type: boolean
ZenScript CopyEnchantment.canEnchant(stack as ItemStack) as boolean
Parameter | Type | Description |
---|---|---|
Parameter stack | Type Pila de objetos | Description No Description Provided |
Name: doPostAttack
Return Type: void
ZenScript CopyEnchantment.doPostAttack(source as LivingEntity, target as Entity, level as int) as void
Parameter | Type | Description |
---|---|---|
Parameter fuente | Type LivingEntity | Description No Description Provided |
Parameter target | Type Entity | Description No Description Provided |
Parameter level | Type int | Description No Description Provided |
Name: doPostHurt
Return Type: void
ZenScript CopyEnchantment.doPostHurt(source as LivingEntity, target as Entity, level as int) as void
Parameter | Type | Description |
---|---|---|
Parameter fuente | Type LivingEntity | Description No Description Provided |
Parameter target | Type Entity | Description No Description Provided |
Parameter level | Type int | Description No Description Provided |
Name: getDamageBonus
Return Type: float
ZenScript CopyEnchantment.getDamageBonus(level as int, mobType as MobType) as float
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description No Description Provided |
Parameter mobType | Type MobType | Description No Description Provided |
Name: getDamageProtection
Return Type: int
ZenScript CopyEnchantment.getDamageProtection(level as int, source as DamageSource) as int
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description No Description Provided |
Parameter fuente | Type DamageSource | Description No Description Provided |
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
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description No Description Provided |
Name: getMaxCost
Return Type: int
ZenScript CopyEnchantment.getMaxCost(level as int) as int
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description No Description Provided |
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
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description 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 CopyEnchantment.getSlotItems(entity as LivingEntity) as ItemStack[EquipmentSlot]
Parameter | Type | Description |
---|---|---|
Parameter entity | Type LivingEntity | Description No Description Provided |
Name: isCompatibleWith
Return Type: boolean
ZenScript CopyEnchantment.isCompatibleWith(other as Enchantment) as boolean
Parameter | Type | Description |
---|---|---|
Parameter other | Type Enchantment | Description 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();
Properties
Link to properties
Nombre | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Nombre commandString | Type string | Has Getter true | Has Setter false | Description No Description Provided |
Nombre descriptionId | Type string | Has Getter true | Has Setter false | Description No Description Provided |
Nombre isCurse | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Nombre isDiscoverable | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Nombre isTradeable | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Nombre isTreasureOnly | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Nombre maxLevel | Type int | Has Getter true | Has Setter false | Description No Description Provided |
Nombre minLevel | Type int | Has Getter true | Has Setter false | Description No Description Provided |
Nombre rarity | Type Rarity | Has Getter true | Has Setter false | Description No Description Provided |