How can I teleport all players to a location, or even just select all players, rather than just a $sender?
foreach($p->getLevel()->getNearbyEntities(new AxisAlignedBB($pos->getX()-10, $pos->getY()-10, $pos->getZ()-10, $pos->getX()+10, $pos->getY()+10, $pos->getZ()+10), $p) as $entity) (+/-10 is the range)
Simple the same i have made a minigame with that. If a player is near 10blocks and a other player break a grassblock all players near will be teleport random in the sky for fall damage... other damage is disable in world ^^
But how would you teleport ALL players in a given world to a location? Not all players near you, all players in the world.