EnchantmentRarity

导入相关包

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.enchantment.EnchantmentRarity;

Extending Enum<EnchantmentRarity>

EnchantmentRarity extends Enum<EnchantmentRarity>. That means all methods available in Enum<EnchantmentRarity> are also available in EnchantmentRarity

Static Properties

名称类型可获得可设置描述
COMMONEnchantmentRaritytruefalseNo Description Provided
RAREEnchantmentRaritytruefalseNo Description Provided
UNCOMMONEnchantmentRaritytruefalseNo Description Provided
VERY_RAREEnchantmentRaritytruefalseNo Description Provided

方法

getWeight

Gets the weight of this enchantment rarity.

Returns: The weight of the enchantment rarity.
Return Type: int

ZenScript
Copy
// EnchantmentRarity.getWeight() as int

EnchantmentRarity.COMMON.getWeight();

参数

名称类型可获得可设置描述
weightinttruefalseGets the weight of this enchantment rarity.