PlayerDisconnectEventTrait
Methods
getDisconnectReason()
public function getDisconnectReason() : \pocketmine\lang\Translatable|stringReturns the kick reason shown in the server log and on the console. When kicked by the /kick command, the default is something like "Kicked by admin.".
getDisconnectScreenMessage()
public function getDisconnectScreenMessage() : \pocketmine\lang\Translatable|string|nullReturns the message shown on the player's disconnection screen. When kicked by the /kick command, the default is something like "Kicked by admin.". If this is null, the kick reason will be used as the disconnect screen message directly.
setDisconnectReason()
public function setDisconnectReason(\pocketmine\lang\Translatable|string $disconnectReason) : voidSets the kick reason shown in the server log and on the console.
This should be a short, simple, single-line message. Do not use long or multi-line messages here - they will spam the log and server console with useless information.
setDisconnectScreenMessage()
public function setDisconnectScreenMessage(\pocketmine\lang\Translatable|string|null $disconnectScreenMessage) : voidSets the message shown on the player's disconnection screen. This can be as long as you like, and may contain formatting and newlines. If this is set to null, the kick reason will be used as the disconnect screen message directly.
