Documentation

EffectInstance
in package

Table of Contents

$ambient  : bool
$amplifier  : int
$color  : Color
$duration  : int
$effectType  : Effect
$visible  : bool
__construct()  : mixed
decreaseDuration()  : $this
Decreases the duration by the given number of ticks, without dropping below zero.
getAmplifier()  : int
getColor()  : Color
Returns the particle colour of this effect instance. This can be overridden on a per-EffectInstance basis, so it is not reflective of the default colour of the effect.
getDuration()  : int
Returns the number of ticks remaining until the effect expires.
getEffectLevel()  : int
Returns the level of this effect, which is always one higher than the amplifier.
getType()  : Effect
hasExpired()  : bool
Returns whether the duration has run out.
isAmbient()  : bool
Returns whether the effect originated from the ambient environment.
isVisible()  : bool
Returns whether this effect will produce some visible effect, such as bubbles or particles.
resetColor()  : EffectInstance
Resets the colour of this EffectInstance to the default specified by its type.
setAmbient()  : $this
setAmplifier()  : $this
setColor()  : EffectInstance
Sets the colour of this EffectInstance.
setDuration()  : $this
Sets the number of ticks remaining until the effect expires.
setVisible()  : $this

Properties

Methods

__construct()

public __construct(Effect $effectType[, int|null $duration = null ][, int $amplifier = 0 ][, bool $visible = true ][, bool $ambient = false ][, Color|null $overrideColor = null ]) : mixed
Parameters
$effectType : Effect
$duration : int|null = null

Passing null will use the effect type's default duration

$amplifier : int = 0
$visible : bool = true
$ambient : bool = false
$overrideColor : Color|null = null
Return values
mixed

decreaseDuration()

Decreases the duration by the given number of ticks, without dropping below zero.

public decreaseDuration(int $ticks) : $this
Parameters
$ticks : int
Return values
$this

getAmplifier()

public getAmplifier() : int
Return values
int

getColor()

Returns the particle colour of this effect instance. This can be overridden on a per-EffectInstance basis, so it is not reflective of the default colour of the effect.

public getColor() : Color
Return values
Color

getDuration()

Returns the number of ticks remaining until the effect expires.

public getDuration() : int
Return values
int

getEffectLevel()

Returns the level of this effect, which is always one higher than the amplifier.

public getEffectLevel() : int
Return values
int

hasExpired()

Returns whether the duration has run out.

public hasExpired() : bool
Return values
bool

isAmbient()

Returns whether the effect originated from the ambient environment.

public isAmbient() : bool

Ambient effects can originate from things such as a Beacon's area of effect radius. If this flag is set, the amount of visible particles will be reduced by a factor of 5.

Return values
bool

isVisible()

Returns whether this effect will produce some visible effect, such as bubbles or particles.

public isVisible() : bool
Return values
bool

setAmbient()

public setAmbient([bool $ambient = true ]) : $this
Parameters
$ambient : bool = true
Return values
$this

setAmplifier()

public setAmplifier(int $amplifier) : $this
Parameters
$amplifier : int
Return values
$this

setDuration()

Sets the number of ticks remaining until the effect expires.

public setDuration(int $duration) : $this
Parameters
$duration : int
Tags
throws
InvalidArgumentException
Return values
$this

setVisible()

public setVisible([bool $visible = true ]) : $this
Parameters
$visible : bool = true
Return values
$this

Search results