diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 05bf75f4b..b359d791e 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -400,7 +400,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ * @param bool $playSound Whether to play level-up and XP gained sounds. */ public function addXp(int $amount, bool $playSound = true) : bool{ - $this->totalXp += $amount; + if($amount > 0){ + $this->totalXp += $amount; + } $oldLevel = $this->getXpLevel(); $oldTotal = $this->getCurrentTotalXp();