Package org.bukkit.event.player

# Class PlayerQuitEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerQuitEvent

public class PlayerQuitEvent extends PlayerEvent
Called when a player leaves a server

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`PlayerQuitEvent.QuitReason`

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.player.PlayerEvent

`player`

## Constructor Summary

Constructors
Constructor
Description
`PlayerQuitEvent(@NotNull Player who, @Nullable String quitMessage)`
Deprecated.
`PlayerQuitEvent(@NotNull Player who, @Nullable String quitMessage, @Nullable PlayerQuitEvent.QuitReason quitReason)`
Deprecated.
`PlayerQuitEvent(@NotNull Player who, Component quitMessage)`
Deprecated.
`PlayerQuitEvent(@NotNull Player who, Component quitMessage, @Nullable PlayerQuitEvent.QuitReason quitReason)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@Nullable String`
`getQuitMessage()`
Deprecated.
in favour of `quitMessage()`
`@NotNull PlayerQuitEvent.QuitReason`
`getReason()`
`Component`
`quitMessage()`
Gets the quit message to send to all online players
`void`
`quitMessage(Component quitMessage)`
Sets the quit message to send to all online players
`void`
`setQuitMessage(@Nullable String quitMessage)`
Deprecated.
in favour of `quitMessage(net.kyori.adventure.text.Component)`

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerQuitEvent

@Deprecated public PlayerQuitEvent(@NotNull @NotNull Player who, @Nullable @Nullable String quitMessage)
Deprecated.

### PlayerQuitEvent

@Deprecated public PlayerQuitEvent(@NotNull @NotNull Player who, @Nullable @Nullable String quitMessage, @Nullable @Nullable PlayerQuitEvent.QuitReason quitReason)
Deprecated.

### PlayerQuitEvent

@Deprecated public PlayerQuitEvent(@NotNull @NotNull Player who, @Nullable Component quitMessage)
Deprecated.

### PlayerQuitEvent

public PlayerQuitEvent(@NotNull @NotNull Player who, @Nullable Component quitMessage, @Nullable @Nullable PlayerQuitEvent.QuitReason quitReason)

## Method Details

### quitMessage

@Nullable public Component quitMessage()
Gets the quit message to send to all online players

Returns:
  string quit message

### quitMessage

public void quitMessage(@Nullable Component quitMessage)
Sets the quit message to send to all online players

Parameters:
  `quitMessage` - quit message

### getQuitMessage

@Nullable @Deprecated public @Nullable String getQuitMessage()
Deprecated.
in favour of `quitMessage()`
Gets the quit message to send to all online players

Returns:
  string quit message

### setQuitMessage

@Deprecated public void setQuitMessage(@Nullable @Nullable String quitMessage)
Deprecated.
in favour of `quitMessage(net.kyori.adventure.text.Component)`
Sets the quit message to send to all online players

Parameters:
  `quitMessage` - quit message

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()

### getReason

@NotNull public @NotNull PlayerQuitEvent.QuitReason getReason()