hi i want to make spectator mode in my plugin. I despawn all cpectators to another players but players cant place block if there is a player in spectator mode. How can i fix this?
Non of the big server networks has been fixed or worried about this. Try to kick spectators back if he is too close to normal player
Actually, what do you want? You can use adventure settings packet. Find more information at https://github.com/PocketMine/Pocke...4540016032bf5/src/pocketmine/Player.php#L1140
PHP: if($hand->isSolid() === true and $hand->getBoundingBox() !== null){$entities = $this->getCollidingEntities($hand->getBoundingBox());$realCount = 0;foreach($entities as $e){if($e instanceof Arrow or $e instanceof DroppedItem or ($e instanceof Player && $e->isSpectator())){ //editedcontinue;}++$realCount;}if($player !== null){if(($diff = $player->getNextPosition()->subtract($player->getPosition())) and $diff->lengthSquared() > 0.00001){$bb = $player->getBoundingBox()->getOffsetBoundingBox($diff->x, $diff->y, $diff->z);if($hand->getBoundingBox()->intersectsWith($bb)){++$realCount;}}}if($realCount > 0){return false; //Entity in block}} will it work?