Interface Enchantment.Builder
- All Superinterfaces:
- AbstractBuilder<Enchantment>,- Builder<Enchantment,,- Enchantment.Builder> - CopyableBuilder<Enchantment,,- Enchantment.Builder> - DataBuilder<Enchantment>,- ResettableBuilder<Enchantment,- Enchantment.Builder> 
- Enclosing interface:
- Enchantment
public static interface Enchantment.Builder
extends Builder<Enchantment,Enchantment.Builder>, CopyableBuilder<Enchantment,Enchantment.Builder>, DataBuilder<Enchantment>  
Represents a builder interface which can be used
 to create a 
Enchantment.- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds an instance of aEnchantmentbased on the entered information.level(int level) Sets the level for this enchantment.default Enchantment.Buildertype(Supplier<? extends EnchantmentType> enchantmentType) Sets theEnchantmentTypefor this enchantment.type(EnchantmentType enchantmentType) Sets theEnchantmentTypefor this enchantment.Methods inherited from interface org.spongepowered.api.util.CopyableBuilderfromMethods inherited from interface org.spongepowered.api.data.persistence.DataBuilderbuild
- 
Method Details- 
typeSets theEnchantmentTypefor this enchantment.- Parameters:
- enchantmentType- The desired enchantment type
- Returns:
- The modified builder, for chaining
 
- 
typeSets theEnchantmentTypefor this enchantment.- Parameters:
- enchantmentType- The desired enchantment type
- Returns:
- The modified builder, for chaining
 
- 
levelSets the level for this enchantment.This level must be between Short.MIN_VALUEandShort.MAX_VALUE, but there is no guarantee all levels will work properly without error. It is recommended for reliable results you stay betweenEnchantmentType.minimumLevel()andEnchantmentType.maximumLevel(), or at least larger than0and less thanShort.MAX_VALUE.- Parameters:
- level- The desired level
- Returns:
- The modified builder for chaining
- Throws:
- IllegalArgumentException- If the level is smaller than- Short.MIN_VALUEor larger than- Short.MAX_VALUE
 
- 
buildBuilds an instance of aEnchantmentbased on the entered information.- Specified by:
- buildin interface- AbstractBuilder<Enchantment>
- Returns:
- The created enchantment
- Throws:
- IllegalStateException- If a required value was not specified
 
 
-