Package org.bukkit.event.player

# Class PlayerJoinEvent

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

public class PlayerJoinEvent extends PlayerEvent
Called when a player joins a server

## Nested Class Summary

## 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
`PlayerJoinEvent(@NotNull Player playerJoined, @Nullable String joinMessage)`
Deprecated.
`PlayerJoinEvent(@NotNull Player playerJoined, Component joinMessage)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@Nullable String`
`getJoinMessage()`
Deprecated.
in favour of `joinMessage()`
`Component`
`joinMessage()`
Gets the join message to send to all online players
`void`
`joinMessage(Component joinMessage)`
Sets the join message to send to all online players
`void`
`setJoinMessage(@Nullable String joinMessage)`
Deprecated.
in favour of `joinMessage(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

### PlayerJoinEvent

public PlayerJoinEvent(@NotNull @NotNull Player playerJoined, @Nullable Component joinMessage)

### PlayerJoinEvent

@Deprecated public PlayerJoinEvent(@NotNull @NotNull Player playerJoined, @Nullable @Nullable String joinMessage)
Deprecated.

## Method Details

### joinMessage

@Nullable public Component joinMessage()
Gets the join message to send to all online players

Returns:
  string join message. Can be null

### joinMessage

public void joinMessage(@Nullable Component joinMessage)
Sets the join message to send to all online players

Parameters:
  `joinMessage` - join message. If null, no message will be sent

### getJoinMessage

@Nullable @Deprecated public @Nullable String getJoinMessage()
Deprecated.
in favour of `joinMessage()`
Gets the join message to send to all online players

Returns:
  string join message. Can be null

### setJoinMessage

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

Parameters:
  `joinMessage` - join message. If null, no message will be sent

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()