Class PreJoinEvent

java.lang.Object
com.welcome234.pluginsystem.events.PreJoinEvent

public class PreJoinEvent extends Object
Called when a player connects to the server
  • Constructor Details

    • PreJoinEvent

      public PreJoinEvent(String playername, InetAddress address, int port)
  • Method Details

    • getUsername

      public String getUsername()
      Gets the username this player is joining with
      Returns:
      Player username
    • getAddress

      public InetAddress getAddress()
      Gets the IP address this player is joining with
      Returns:
      IP address
    • getPort

      public int getPort()
      Gets the port this player is joining with
      Returns:
      Port number
    • getDeniedMessage

      public String getDeniedMessage()
      Gets the reason why the connection was denied to the server, or empty string if allowed
      Returns:
      Deny reason
    • accept

      public void accept()
      Allows the connection to the server
    • deny

      public void deny(String denyMessage)
      Denies the connection to the server with the specified reason
      Parameters:
      denyMessage - Deny reason
      Throws:
      IllegalArgumentException - if denyMessage is null