PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\entity\effect\Effect Class Reference
+ Inheritance diagram for pocketmine\entity\effect\Effect:
+ Collaboration diagram for pocketmine\entity\effect\Effect:

Public Member Functions

 __construct (protected Translatable|string $name, protected Color $color, protected bool $bad=false, private int $defaultDuration=600, protected bool $hasBubbles=true)
 
 add (Living $entity, EffectInstance $instance)
 
 applyEffect (Living $entity, EffectInstance $instance, float $potency=1.0, ?Entity $source=null)
 
 canTick (EffectInstance $instance)
 
 getColor ()
 
 getDefaultDuration ()
 
 getName ()
 
 hasBubbles ()
 
 isBad ()
 
 remove (Living $entity, EffectInstance $instance)
 

Detailed Description

Definition at line 33 of file Effect.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\entity\effect\Effect::__construct ( protected Translatable|string $name,
protected Color $color,
protected bool $bad = false,
private int $defaultDuration = 600,
protected bool $hasBubbles = true )
Parameters
Translatable | string$nameTranslation key used for effect name
Color$colorColor of bubbles given by this effect
bool$badWhether the effect is harmful
bool$hasBubblesWhether the effect has potion bubbles. Some do not (e.g. Instant Damage has its own particles instead of bubbles)

Definition at line 43 of file Effect.php.

Member Function Documentation

◆ add()

pocketmine\entity\effect\Effect::add ( Living $entity,
EffectInstance $instance )

◆ applyEffect()

pocketmine\entity\effect\Effect::applyEffect ( Living $entity,
EffectInstance $instance,
float $potency = 1.0,
?Entity $source = null )

◆ canTick()

pocketmine\entity\effect\Effect::canTick ( EffectInstance $instance)

◆ getColor()

pocketmine\entity\effect\Effect::getColor ( )

Returns a Color object representing this effect's particle colour.

Definition at line 61 of file Effect.php.

Referenced by pocketmine\entity\effect\EffectInstance\__construct().

+ Here is the caller graph for this function:

◆ getDefaultDuration()

pocketmine\entity\effect\Effect::getDefaultDuration ( )

Returns the default duration (in ticks) this effect will apply for if a duration is not specified.

Definition at line 76 of file Effect.php.

Referenced by pocketmine\entity\effect\EffectInstance\__construct().

+ Here is the caller graph for this function:

◆ getName()

pocketmine\entity\effect\Effect::getName ( )

Returns the translation key used to translate this effect's name.

Definition at line 54 of file Effect.php.

◆ hasBubbles()

pocketmine\entity\effect\Effect::hasBubbles ( )

Returns whether this effect will give the subject potion bubbles.

Definition at line 83 of file Effect.php.

◆ isBad()

pocketmine\entity\effect\Effect::isBad ( )

Returns whether this effect is harmful. TODO: implement inverse effect results for undead mobs

Definition at line 69 of file Effect.php.

◆ remove()

pocketmine\entity\effect\Effect::remove ( Living $entity,
EffectInstance $instance )

The documentation for this class was generated from the following file: