PHP: /** @var Player $player *//* @var int $maxDistance The distance the entity needed to be within *//** @var Entity $entity The entity within the radius */foreach($player->getLevel()->getNearbyEntities($player->getBoundingBox()->expandedCopy($maxDistance, $maxDistance, $maxDistance)) as $entity){ if($entity->getId() !== $player->getId()){ // $entity is within the radius of $player }}