diff --git a/src/event/player/PlayerQuitEvent.php b/src/event/player/PlayerQuitEvent.php index 9791cd893..3e08cb315 100644 --- a/src/event/player/PlayerQuitEvent.php +++ b/src/event/player/PlayerQuitEvent.php @@ -27,7 +27,14 @@ use pocketmine\lang\Translatable; use pocketmine\player\Player; /** - * Called when a player leaves the server + * Called when a player disconnects from the server for any reason. + * + * Some possible reasons include: + * - being kicked by an operator + * - disconnecting from the game + * - timeout due to network connectivity issues + * + * @see PlayerKickEvent */ class PlayerQuitEvent extends PlayerEvent{ @@ -42,14 +49,23 @@ class PlayerQuitEvent extends PlayerEvent{ $this->quitReason = $quitReason; } + /** + * Sets the quit message broadcasted to other players. + */ public function setQuitMessage(Translatable|string $quitMessage) : void{ $this->quitMessage = $quitMessage; } + /** + * Returns the quit message broadcasted to other players, e.g. "Steve left the game". + */ public function getQuitMessage() : Translatable|string{ return $this->quitMessage; } + /** + * Returns the disconnect reason shown in the server log and on the console. + */ public function getQuitReason() : string{ return $this->quitReason; }