public static interface PotionEffect.Builder extends DataBuilder<PotionEffect>
PotionEffect.| Modifier and Type | Method and Description |
|---|---|
PotionEffect.Builder |
ambience(boolean ambience)
Sets the potion effect to be ambient or not.
|
PotionEffect.Builder |
amplifier(int amplifier)
Sets the amplifier power of the potion effect.
|
PotionEffect |
build()
Builds an instance of a PotionEffect.
|
PotionEffect.Builder |
duration(int duration)
Sets the duration in ticks of the potion effect.
|
PotionEffect.Builder |
from(PotionEffect potionEffect)
Resets this builder to the values of the given built object.
|
PotionEffect.Builder |
particles(boolean showsParticles)
Sets the potion effect to show particles when applied or not.
|
PotionEffect.Builder |
potionType(PotionEffectType potionEffectType)
Sets the
PotionEffectType of the potion. |
PotionEffect.Builder |
reset()
Resets this builder to a "default" state such that there is no
remaining data to set.
|
buildPotionEffect.Builder from(PotionEffect potionEffect)
ResettableBuilderfrom in interface DataBuilder<PotionEffect>from in interface ResettableBuilder<PotionEffect,DataBuilder<PotionEffect>>potionEffect - The built objectPotionEffect.Builder potionType(PotionEffectType potionEffectType)
PotionEffectType of the potion.potionEffectType - The type of itemPotionEffect.Builder duration(int duration)
duration - The duration in ticks of this effectPotionEffect.Builder amplifier(int amplifier) throws IllegalArgumentException
Amplifiers must be above zero.
amplifier - The amplifier powerIllegalArgumentException - If the amplifier is less than zeroPotionEffect.Builder ambience(boolean ambience)
ambience - Whether the potion effect is ambientPotionEffect.Builder particles(boolean showsParticles)
showsParticles - Whether the potion effect will show particlesPotionEffect build() throws IllegalStateException
IllegalStateException - If the potion effect is not completedPotionEffect.Builder reset()
ResettableBuilderreset in interface DataBuilder<PotionEffect>reset in interface ResettableBuilder<PotionEffect,DataBuilder<PotionEffect>>