public static interface Enchantment.Builder extends DataBuilder<Enchantment>
Enchantment
.Modifier and Type | Method and Description |
---|---|
Enchantment |
build()
Builds an instance of a
Enchantment based on the entered
information. |
Enchantment.Builder |
level(int level)
Sets the level for this enchantment.
|
Enchantment.Builder |
type(EnchantmentType enchantmentType)
Sets the
EnchantmentType for this enchantment. |
build, from, reset
Enchantment.Builder type(EnchantmentType enchantmentType)
EnchantmentType
for this enchantment.enchantmentType
- The desired enchantment typeEnchantment.Builder level(int level) throws IllegalArgumentException
This level must be between Short.MIN_VALUE
and
Short.MAX_VALUE
, but there is no guarantee all levels will
work properly without error. It is recommended for reliable results
you stay between EnchantmentType.getMinimumLevel()
and
EnchantmentType.getMaximumLevel()
, or at least larger
than 0
and less than Short.MAX_VALUE
.
level
- The desired levelIllegalArgumentException
- If the level is smaller than
Short.MIN_VALUE
or larger than Short.MAX_VALUE
Enchantment build() throws IllegalStateException
Enchantment
based on the entered
information.IllegalStateException
- If a required value was not specified