pocketmine\Player::isSpectator PHP Method

isSpectator() public method

public isSpectator ( ) : boolean
return boolean
    public function isSpectator() : bool
    {
        return $this->gamemode === 3;
    }

Usage Example

Example #1
0
 /**
  * Clear players inventory
  * @param Player $target
  */
 public static function clearInventory(Player $target)
 {
     if ($target->isCreative() || $target->isSpectator()) {
         return;
     }
     $target->getInventory()->clearAll();
 }
All Usage Examples Of pocketmine\Player::isSpectator
Player