SelectorContext 5.46.0
What a target selector is evaluated against: the executing entity (@s), the origin used for distances and relative coordinates, and where to look for players and entities.
Methods
__construct()
php
public function __construct(?\pocketmine\entity\Entity $executor, ?\pocketmine\world\World $world, \pocketmine\math\Vector3 $origin, float $yaw, float $pitch, \Closure $players, \Closure $worlds, \pocketmine\player\GameMode $defaultGameMode)fromSender()
php
public static function fromSender(\pocketmine\command\CommandSender $sender) : selfContext of a command sender: an entity sender (a player) is the executor and the origin; any other sender (the console, RCON...) uses the default world's spawn, like a Bedrock command block-less server console.
getDefaultGameMode()
php
public function getDefaultGameMode() : \pocketmine\player\GameModeGame mode matched by m=default / m=d / m=5.
getExecutor()
php
public function getExecutor() : ?\pocketmine\entity\EntityThe entity running the command (@s), or null for the console and other non-entity senders.
getOrigin()
php
public function getOrigin() : \pocketmine\math\Vector3getPitch()
php
public function getPitch() : floatgetPlayers()
php
public function getPlayers() : arraygetWorld()
php
public function getWorld() : ?\pocketmine\world\WorldWorld of the origin (null if the server has no default world).
getWorlds()
php
public function getWorlds() : arraygetYaw()
php
public function getYaw() : float