PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
|
Public Member Functions | |
__construct (Effect $effectType, ?int $duration=null, int $amplifier=0, bool $visible=true, bool $ambient=false, ?Color $overrideColor=null) | |
decreaseDuration (int $ticks) | |
getAmplifier () | |
getColor () | |
getDuration () | |
getEffectLevel () | |
getType () | |
hasExpired () | |
isAmbient () | |
isVisible () | |
resetColor () | |
setAmbient (bool $ambient=true) | |
setAmplifier (int $amplifier) | |
setColor (Color $color) | |
setDuration (int $duration) | |
setVisible (bool $visible=true) | |
Definition at line 30 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::__construct | ( | Effect | $effectType, |
?int | $duration = null, | ||
int | $amplifier = 0, | ||
bool | $visible = true, | ||
bool | $ambient = false, | ||
?Color | $overrideColor = null ) |
int | null | $duration | Passing null will use the effect type's default duration |
Definition at line 41 of file EffectInstance.php.
References pocketmine\entity\effect\Effect\getColor(), pocketmine\entity\effect\Effect\getDefaultDuration(), pocketmine\entity\effect\EffectInstance\setAmplifier(), and pocketmine\entity\effect\EffectInstance\setDuration().
pocketmine\entity\effect\EffectInstance::decreaseDuration | ( | int | $ticks | ) |
Decreases the duration by the given number of ticks, without dropping below zero.
Definition at line 82 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::getAmplifier | ( | ) |
Definition at line 95 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::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.
Definition at line 156 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::getDuration | ( | ) |
Returns the number of ticks remaining until the effect expires.
Definition at line 57 of file EffectInstance.php.
Referenced by pocketmine\entity\effect\PoisonEffect\canTick(), pocketmine\entity\effect\RegenerationEffect\canTick(), and pocketmine\entity\effect\WitherEffect\canTick().
pocketmine\entity\effect\EffectInstance::getEffectLevel | ( | ) |
Returns the level of this effect, which is always one higher than the amplifier.
Definition at line 102 of file EffectInstance.php.
Referenced by pocketmine\entity\effect\HungerEffect\applyEffect(), pocketmine\entity\effect\LevitationEffect\applyEffect(), and pocketmine\entity\effect\SaturationEffect\applyEffect().
pocketmine\entity\effect\EffectInstance::getType | ( | ) |
Definition at line 50 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::hasExpired | ( | ) |
Returns whether the duration has run out.
Definition at line 91 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::isAmbient | ( | ) |
Returns whether the effect originated from the ambient environment. 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.
Definition at line 139 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::isVisible | ( | ) |
Returns whether this effect will produce some visible effect, such as bubbles or particles.
Definition at line 121 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::resetColor | ( | ) |
Resets the colour of this EffectInstance to the default specified by its type.
Definition at line 172 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::setAmbient | ( | bool | $ambient = true | ) |
Definition at line 146 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::setAmplifier | ( | int | $amplifier | ) |
Definition at line 109 of file EffectInstance.php.
Referenced by pocketmine\entity\effect\EffectInstance\__construct().
pocketmine\entity\effect\EffectInstance::setColor | ( | Color | $color | ) |
Sets the colour of this EffectInstance.
Definition at line 163 of file EffectInstance.php.
pocketmine\entity\effect\EffectInstance::setDuration | ( | int | $duration | ) |
Sets the number of ticks remaining until the effect expires.
InvalidArgumentException
Definition at line 68 of file EffectInstance.php.
Referenced by pocketmine\entity\effect\EffectInstance\__construct().
pocketmine\entity\effect\EffectInstance::setVisible | ( | bool | $visible = true | ) |
Definition at line 128 of file EffectInstance.php.