Skip to content

PlayerTransferEvent ​

class · pocketmine\event\player\PlayerTransferEvent · source

Extends PlayerEvent
Implements Cancellable

Called when a player attempts to be transferred to another server, e.g. by using /transferserver.

Properties ​

$address ​

php
public string $address

$message ​

php
public \pocketmine\lang\Translatable|string $message

$port ​

php
public int $port

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, string $address, int $port, \pocketmine\lang\Translatable|string $message)

getAddress() ​

php
public function getAddress() : string

Returns the destination server address. This could be an IP or a domain name.

getMessage() ​

php
public function getMessage() : \pocketmine\lang\Translatable|string

Returns the disconnect reason shown in the server log and on the console.

getPort() ​

php
public function getPort() : int

Returns the destination server port.

setAddress() ​

php
public function setAddress(string $address) : void

Sets the destination server address.

setMessage() ​

php
public function setMessage(\pocketmine\lang\Translatable|string $message) : void

Sets the disconnect reason shown in the server log and on the console.

setPort() ​

php
public function setPort(int $port) : void

Sets the destination server port.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.