Interface Enchantment.RandomListBuilder
-
- All Superinterfaces:
AbstractBuilder<java.util.List<Enchantment>>,Buildable.Builder<java.util.List<Enchantment>>,Builder<java.util.List<Enchantment>,Enchantment.RandomListBuilder>,ResettableBuilder<java.util.List<Enchantment>,Enchantment.RandomListBuilder>
- Enclosing interface:
- Enchantment
public static interface Enchantment.RandomListBuilder extends Builder<java.util.List<Enchantment>,Enchantment.RandomListBuilder>
Represents a builder interface which can be used to create aEnchantment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<Enchantment>build()Builds an instance of aEnchantmentbased on the entered information.Enchantment.RandomListBuilderfixedPool(java.util.List<Enchantment> pool)Sets a fixed pool for the random enchantments to pick from.Enchantment.RandomListBuilderitem(ItemStack item)Sets the item for which the enchantments are chosenEnchantment.RandomListBuilderlevel(int level)Sets the enchanting level.Enchantment.RandomListBuilderoption(int option)Sets the enchanting option.Enchantment.RandomListBuilderseed(int seed)Sets the random seed.Enchantment.RandomListBuildertreasure(boolean treasure)Sets whether to include treasure enchantments or not
-
-
-
Method Detail
-
seed
Enchantment.RandomListBuilder seed(int seed)
Sets the random seed.- Parameters:
seed- the random seed- Returns:
- The modified builder, for chaining
-
option
Enchantment.RandomListBuilder option(int option)
Sets the enchanting option. (1-3 in vanilla)- Parameters:
option- the enchanting option- Returns:
- The modified builder, for chaining
-
level
Enchantment.RandomListBuilder level(int level)
Sets the enchanting level. (max. 30 in vanilla)- Parameters:
level- the enchanting level- Returns:
- The modified builder, for chaining
-
treasure
Enchantment.RandomListBuilder treasure(boolean 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
Enchantment.RandomListBuilder fixedPool(java.util.List<Enchantment> pool)
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
Enchantment.RandomListBuilder item(ItemStack 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
java.util.List<Enchantment> build() throws java.lang.IllegalStateException
Builds an instance of aEnchantmentbased on the entered information.- Specified by:
buildin interfaceAbstractBuilder<java.util.List<Enchantment>>- Specified by:
buildin interfaceBuildable.Builder<java.util.List<Enchantment>>- Returns:
- The created enchantment
- Throws:
java.lang.IllegalStateException- If a required value was not specified
-
-