Class PlayerJoinEvent

java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.PlayerJoinEvent

public class PlayerJoinEvent extends MatchboxEvent
Event fired when a player joins a game session.
Since:
0.9.5
  • Constructor Details

    • PlayerJoinEvent

      public PlayerJoinEvent(@NotNull @NotNull String sessionName, @NotNull @NotNull org.bukkit.entity.Player player)
      Creates a new player join event.
      Parameters:
      sessionName - the session name
      player - the player who joined
  • Method Details

    • dispatch

      public void dispatch(@NotNull @NotNull MatchboxEventListener listener)
      Description copied from class: MatchboxEvent
      Dispatches this event to the appropriate listener method.

      This method uses the visitor pattern to call the correct handler method based on the concrete event type. Implementing classes should call super.dispatch(listener) as the first line.

      Specified by:
      dispatch in class MatchboxEvent
      Parameters:
      listener - the listener to dispatch to
    • getSessionName

      @NotNull public @NotNull String getSessionName()
      Gets the name of the session the player joined.
      Returns:
      the session name
    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      Gets the player who joined the session.
      Returns:
      the player