Effect
Properties
$bad
public bool $bad$color
public \pocketmine\color\Color $color$hasBubbles
public bool $hasBubbles$name
public \pocketmine\lang\Translatable|string $nameMethods
__construct()
public function __construct(\pocketmine\lang\Translatable|string $name, \pocketmine\color\Color $color, bool $bad = false, int $defaultDuration = 600, bool $hasBubbles = true)add()
public function add(\pocketmine\entity\Living $entity, \pocketmine\entity\effect\EffectInstance $instance) : voidApplies effects to the entity when the effect is first added.
applyEffect()
public function applyEffect(\pocketmine\entity\Living $entity, \pocketmine\entity\effect\EffectInstance $instance, float $potency = 1.0, ?\pocketmine\entity\Entity $source = null) : voidApplies effect results to an entity. This will not be called unless canTick() returns true.
canTick()
public function canTick(\pocketmine\entity\effect\EffectInstance $instance) : boolDeprecated
Implement getApplyInterval() instead
Returns whether the effect will do something on the current tick.
getApplyInterval()
public function getApplyInterval(\pocketmine\entity\effect\EffectInstance $instance) : intReturns after how many ticks applyEffect() will be called. If this returns 0, the effect will not be ticked. If it returns 1, it will be ticked every tick.
getColor()
public function getColor() : \pocketmine\color\ColorReturns a Color object representing this effect's particle colour.
getDefaultDuration()
public function getDefaultDuration() : intReturns the default duration (in ticks) this effect will apply for if a duration is not specified.
getName()
public function getName() : \pocketmine\lang\Translatable|stringReturns the translation key used to translate this effect's name.
hasBubbles()
public function hasBubbles() : boolReturns whether this effect will give the subject potion bubbles.
isBad()
public function isBad() : boolReturns whether this effect is harmful. TODO: implement inverse effect results for undead mobs
onEntityDeath() 5.46.0
public function onEntityDeath(\pocketmine\entity\Living $entity, \pocketmine\entity\effect\EffectInstance $instance) : voidCalled when an entity dies while it has this effect (e.g. Wind Charged and Weaving act on death).
remove()
public function remove(\pocketmine\entity\Living $entity, \pocketmine\entity\effect\EffectInstance $instance) : voidRemoves the effect from the entity, resetting any changed values back to their original defaults.
