Enum Class ProtocolState

java.lang.Object
java.lang.Enum<ProtocolState>
com.velocitypowered.api.network.ProtocolState
All Implemented Interfaces:
Serializable, Comparable<ProtocolState>, Constable

public enum ProtocolState extends Enum<ProtocolState>
Representation of the state of the protocol in which a connection can be present.
Since:
3.3.0
  • Enum Constant Details

    • HANDSHAKE

      public static final ProtocolState HANDSHAKE
      Initial connection State.

      This status can be caused by a HandshakeIntent.STATUS, HandshakeIntent.LOGIN or HandshakeIntent.TRANSFER intent.

      If the intent is LOGIN or TRANSFER, the next state will be LOGIN, otherwise, it will go to the STATUS state.
    • STATUS

      public static final ProtocolState STATUS
      Ping State of a connection.

      Connections with the HandshakeIntent.STATUS intent will pass through this state and be disconnected after it requests the ping from the server and the server responds with the respective ping.

    • LOGIN

      public static final ProtocolState LOGIN
      Authentication State of a connection.

      At this moment the player is authenticating with the authentication servers.

    • CONFIGURATION

      public static final ProtocolState CONFIGURATION
      Configuration State of a connection.

      At this point the player allows the server to send information such as resource packs and plugin messages, at the same time the player will send his client brand and the respective plugin messages if it is a modded client.

      Since Minecraft:
      1.20.2
    • PLAY

      public static final ProtocolState PLAY
      Game State of a connection.

      In this state is where the whole game runs, the server is able to change the player's state to CONFIGURATION as needed in versions 1.20.2 and higher.

  • Method Details

    • values

      public static ProtocolState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProtocolState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null