From 2b036b1a5c2a14dc036afc0ff8a03c1f2031149d Mon Sep 17 00:00:00 2001 From: Oreo Oreoniv <28255085+zKoz210@users.noreply.github.com> Date: Sat, 24 Feb 2018 16:48:15 +0300 Subject: [PATCH] Added API method Living::hasEffects() (#2054) --- src/pocketmine/entity/Living.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 75e9ca735..893243c2c 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -232,6 +232,14 @@ abstract class Living extends Entity implements Damageable{ public function hasEffect(int $effectId) : bool{ return isset($this->effects[$effectId]); } + + /** + * Returns whether the mob has any active effects. + * @return bool + */ + public function hasEffects() : bool{ + return !empty($this->effects); + } /** * Adds an effect to the mob.