Class PlayerJoinEvent


public class PlayerJoinEvent extends PlayerEvent
Called when a player joins a server and has been placed in loaded chunks.

Teleporting the player during this event will result in undefined behavior. Use AsyncPlayerSpawnLocationEvent to change the spawn location.

  • Constructor Details

    • PlayerJoinEvent

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

      @Internal @Deprecated(forRemoval=true) public PlayerJoinEvent(@NotNull @NotNull Player playerJoined, @Nullable @Nullable String joinMessage)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • joinMessage

      @Nullable public @Nullable Component joinMessage()
      Gets the join message to send to all online players
      Returns:
      string join message. Can be null
    • joinMessage

      public void joinMessage(@Nullable @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.
      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()