Class ConnectionRequestEvent

java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionRequestEvent
All Implemented Interfaces:
org.geysermc.event.Cancellable, org.geysermc.event.Event

public final class ConnectionRequestEvent extends Object implements org.geysermc.event.Event, org.geysermc.event.Cancellable
Called whenever a client attempts to connect to the server, before the connection is accepted.
  • Constructor Details

  • Method Details

    • getInetSocketAddress

      @Deprecated(since="2.3.0", forRemoval=true) public InetSocketAddress getInetSocketAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.3.0: use inetSocketAddress() instead
      The IP address of the client attempting to connect

      This method is deprecated for removal and will be removed in Geyser 2.13.0.

      Returns:
      the IP address of the client attempting to connect
    • getProxyIp

      @Deprecated(since="2.3.0", forRemoval=true) public @Nullable InetSocketAddress getProxyIp()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.3.0: use proxyIp() instead
      The IP address of the proxy handling the connection. It will return null if there is no proxy.

      This method is deprecated for removal and will be removed in Geyser 2.13.0.

      Returns:
      the IP address of the proxy handling the connection
    • inetSocketAddress

      public InetSocketAddress inetSocketAddress()
      The IP address of the client attempting to connect
      Returns:
      the IP address of the client attempting to connect
    • proxyIp

      public @Nullable InetSocketAddress proxyIp()
      The IP address of the proxy handling the connection. It will return null if there is no proxy.
      Returns:
      the IP address of the proxy handling the connection
    • isCancelled

      public boolean isCancelled()
      The cancel status of this event. If this event is cancelled, the connection will be rejected.
      Specified by:
      isCancelled in interface org.geysermc.event.Cancellable
      Returns:
      the cancel status of this event
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets the cancel status of this event. If this event is canceled, the connection will be rejected.
      Specified by:
      setCancelled in interface org.geysermc.event.Cancellable
      Parameters:
      cancelled - the cancel status of this event.