Interface PotionEffect.Builder
- 
- All Superinterfaces:
- AbstractBuilder<PotionEffect>,- Buildable.Builder<PotionEffect>,- Builder<PotionEffect,PotionEffect.Builder>,- CopyableBuilder<PotionEffect,PotionEffect.Builder>,- DataBuilder<PotionEffect>,- ResettableBuilder<PotionEffect,PotionEffect.Builder>
 - Enclosing interface:
- PotionEffect
 
 public static interface PotionEffect.Builder extends Builder<PotionEffect,PotionEffect.Builder>, CopyableBuilder<PotionEffect,PotionEffect.Builder>, DataBuilder<PotionEffect> Represents a builder interface to create aPotionEffect.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PotionEffect.Builderambient(boolean ambient)Sets whether the potion effect is ambient.PotionEffect.Builderamplifier(int amplifier)Sets the amplifier power of the potion effect.PotionEffectbuild()Builds an instance of a PotionEffect.PotionEffect.Builderduration(Ticks duration)Sets the duration in ticks of the potion effect.default PotionEffect.BuilderpotionType(java.util.function.Supplier<? extends PotionEffectType> potionEffectType)Sets thePotionEffectTypeof the potion.PotionEffect.BuilderpotionType(PotionEffectType potionEffectType)Sets thePotionEffectTypeof the potion.PotionEffect.BuildershowIcon(boolean showIcon)Sets whether the potion effect should show its icon when applied.PotionEffect.BuildershowParticles(boolean showParticles)Sets whether the potion effect should show particles when applied.- 
Methods inherited from interface org.spongepowered.api.util.CopyableBuilderfrom
 - 
Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilderbuild
 
- 
 
- 
- 
- 
Method Detail- 
potionTypePotionEffect.Builder potionType(PotionEffectType potionEffectType) Sets thePotionEffectTypeof the potion.- Parameters:
- potionEffectType- The type of item
- Returns:
- This builder, for chaining
 
 - 
potionTypedefault PotionEffect.Builder potionType(java.util.function.Supplier<? extends PotionEffectType> potionEffectType) Sets thePotionEffectTypeof the potion.- Parameters:
- potionEffectType- The type of item
- Returns:
- This builder, for chaining
 
 - 
durationPotionEffect.Builder duration(Ticks duration) throws java.lang.IllegalArgumentException Sets the duration in ticks of the potion effect.The duration must be greater than zero ticks. - Parameters:
- duration- The duration in ticks of this effect
- Returns:
- This builder, for chaining
- Throws:
- java.lang.IllegalArgumentException- If the duration is less than or equal to zero
 
 - 
amplifierPotionEffect.Builder amplifier(int amplifier) throws java.lang.IllegalArgumentException Sets the amplifier power of the potion effect.Amplifiers must be greater than or equal to zero. See PotionEffect.amplifier()for an explanation of what the amplifier means.- Parameters:
- amplifier- The amplifier power
- Returns:
- This builder, for chaining
- Throws:
- java.lang.IllegalArgumentException- If the amplifier is less than zero
 
 - 
ambientPotionEffect.Builder ambient(boolean ambient) Sets whether the potion effect is ambient. Ambient potions emit more translucent particles.- Parameters:
- ambient- Whether the potion effect is ambient
- Returns:
- This builder, for chaining
 
 - 
showParticlesPotionEffect.Builder showParticles(boolean showParticles) Sets whether the potion effect should show particles when applied.- Parameters:
- showParticles- Whether the potion effect will show particles
- Returns:
- This builder, for chaining
 
 - 
showIconPotionEffect.Builder showIcon(boolean showIcon) Sets whether the potion effect should show its icon when applied.- Parameters:
- showIcon- Whether the potion effect will show its icon
- Returns:
- This builder, for chaining
 
 - 
buildPotionEffect build() throws java.lang.IllegalStateException Builds an instance of a PotionEffect.- Specified by:
- buildin interface- AbstractBuilder<PotionEffect>
- Specified by:
- buildin interface- Buildable.Builder<PotionEffect>
- Returns:
- A new instance of a PotionEffect
- Throws:
- java.lang.IllegalStateException- If the potion effect is not completed
 
 
- 
 
-