public interface PotionEffect extends DataSerializable, PropertyHolder
PotionEffectType for a specified
getDuration(), getAmplifier(), and
getShowParticles(). The PotionEffect itself is immutable
once created and can be offered to Entity instances through
the PotionEffectData.| Modifier and Type | Interface and Description |
|---|---|
static interface |
PotionEffect.Builder
Represents a builder interface to create a
PotionEffect. |
| Modifier and Type | Method and Description |
|---|---|
static PotionEffect.Builder |
builder()
Creates a new
PotionEffect.Builder to build a PotionEffect. |
int |
getAmplifier()
Gets the amplifier at which this potion effect
will apply effects.
|
int |
getDuration()
Gets the duration in ticks for which this potion effect
will apply for.
|
boolean |
getShowParticles()
Gets whether or not this potion effect should
show particles.
|
PotionEffectType |
getType()
Gets the
PotionEffectType of this potion. |
boolean |
isAmbient()
Gets if the potion effect is an ambient effect.
|
static PotionEffect |
of(PotionEffectType type,
int amplifier,
int duration)
Creates a new
PotionEffect with the provided
PotionEffectType, the provided amplifier, and the provided
duration in ticks. |
getContentVersion, toContainergetApplicableProperties, getPropertystatic PotionEffect.Builder builder()
PotionEffect.Builder to build a PotionEffect.static PotionEffect of(PotionEffectType type, int amplifier, int duration)
PotionEffect with the provided
PotionEffectType, the provided amplifier, and the provided
duration in ticks.type - The potion typeamplifier - The amplifierduration - The duration in ticksPotionEffectType getType()
PotionEffectType of this potion.int getDuration()
int getAmplifier()
boolean isAmbient()
boolean getShowParticles()