diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 4e4bfd6e0..7c0181499 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -611,8 +611,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ protected function doAirSupplyTick(int $tickDiff){ //TODO: allow this to apply to other mobs - if(($ench = $this->inventory->getHelmet()->getEnchantment(Enchantment::RESPIRATION)) === null or - lcg_value() <= (1 / ($ench->getLevel() + 1))){ + if(($respirationLevel = $this->inventory->getHelmet()->getEnchantmentLevel(Enchantment::RESPIRATION)) <= 0 or + lcg_value() <= (1 / ($respirationLevel + 1))){ parent::doAirSupplyTick($tickDiff); } }