Interface Enchantment.RandomListBuilder
- All Superinterfaces:
AbstractBuilder<List<Enchantment>>
,Builder<List<Enchantment>,
,Enchantment.RandomListBuilder> ResettableBuilder<List<Enchantment>,
Enchantment.RandomListBuilder>
- Enclosing interface:
- Enchantment
public static interface Enchantment.RandomListBuilder
extends Builder<List<Enchantment>,Enchantment.RandomListBuilder>
Represents a builder interface which can be used
to create a
Enchantment
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an instance of aEnchantment
based on the entered information.fixedPool
(List<Enchantment> pool) Sets a fixed pool for the random enchantments to pick from.Sets the item for which the enchantments are chosenlevel
(int level) Sets the enchanting level.option
(int option) Sets the enchanting option.seed
(int seed) Sets the random seed.treasure
(boolean treasure) Sets whether to include treasure enchantments or not
-
Method Details
-
seed
Sets the random seed.- Parameters:
seed
- the random seed- Returns:
- The modified builder, for chaining
-
option
Sets the enchanting option. (1-3 in vanilla)- Parameters:
option
- the enchanting option- Returns:
- The modified builder, for chaining
-
level
Sets the enchanting level. (max. 30 in vanilla)- Parameters:
level
- the enchanting level- Returns:
- The modified builder, for chaining
-
treasure
Sets whether to include treasure enchantments or not- Parameters:
treasure
- whether to include treasure enchantments or not- Returns:
- The modified builder, for chaining
-
fixedPool
Sets a fixed pool for the random enchantments to pick from.If empty a pool will be calculated based on the other values instead.
- Parameters:
pool
- the fixed pool of enchantments- Returns:
- The modified builder, for chaining
-
item
Sets the item for which the enchantments are chosen- Parameters:
item
- the item for which the enchantments are chosen- Returns:
- The modified builder, for chaining
-
build
Builds an instance of aEnchantment
based on the entered information.- Specified by:
build
in interfaceAbstractBuilder<List<Enchantment>>
- Returns:
- The created enchantment
- Throws:
IllegalStateException
- If a required value was not specified
-