pocketmine\Player::setExpLevel PHP Méthode

setExpLevel() public méthode

Deprecation: Use Human::setXpLevel($level), this method will be removed in the future.
public setExpLevel ( integer $level )
$level integer
    public function setExpLevel(int $level)
    {
        trigger_error("This method is deprecated, do not use it", E_USER_DEPRECATED);
        return $this->setXpLevel($level);
    }

Usage Example

 public function onRename(Item $item, Player $player) : bool
 {
     if ($player->getExpLevel() > $item->getRepairCost()) {
         $player->setExpLevel($player->getExpLevel() - $item->getRepairCost());
         return true;
     }
     return false;
 }
All Usage Examples Of pocketmine\Player::setExpLevel
Player