PlayerProxyTransferEvent 5.46.0
Extends PlayerEvent
Implements Cancellable
Called when a player of this server is about to be moved to another server of the pm-proxy network. The player stays connected: the proxy moves it without a reconnection. Cancel it to keep the player here (combat loggers, minigames).
It is called:
- when the move is asked on this server (/server, /hub,
\pocketmine\network\proxy\ProxyNetwork::transfer(), orPlayer::transfer()with the name of a server of the network), before the request goes to the proxy; - when the move comes from elsewhere (/send or a plugin on another server, the proxy's admin API), when the proxy is about to take the player. The target is then the server the proxy chose, and changing it has no effect.
Not called when the server stops and the proxy moves its players to the lobby. A player who is dead, or who gets hurt while the camera of a cinematic transfer flies up, stays here.
Properties
$style
php
public string $style$target
php
public string $targetMethods
__construct()
php
public function __construct(\pocketmine\player\Player $player, string $target, string $style)getStyle()
php
public function getStyle() : stringOne of the STYLE_ constants of \pocketmine\network\proxy\ProxyNetwork, or "" for the proxy's default.
getTarget()
php
public function getTarget() : stringServer or group of the network the player goes to, or \pocketmine\network\proxy\ProxyNetwork::TARGET_HUB.
setStyle()
php
public function setStyle(string $style) : voidsetTarget()
php
public function setTarget(string $target) : void