Enum Class ChatMessageType

java.lang.Object
java.lang.Enum<ChatMessageType>
net.minestom.server.message.ChatMessageType
All Implemented Interfaces:
Serializable, Comparable<ChatMessageType>, Constable

public enum ChatMessageType extends Enum<ChatMessageType>
The messages that a player is willing to receive.
  • Enum Constant Details

    • FULL

      public static final ChatMessageType FULL
      The client wants all chat messages.
    • SYSTEM

      public static final ChatMessageType SYSTEM
      The client only wants messages from commands, or system messages.
    • NONE

      public static final ChatMessageType NONE
      The client doesn't want any messages.
  • Method Details

    • values

      public static ChatMessageType[] 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 ChatMessageType 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
    • accepts

      public boolean accepts(@NotNull @NotNull ChatPosition chatPosition)
      Checks if this message type is accepting of messages from a given position.
      Parameters:
      chatPosition - the position
      Returns:
      if the message is accepted
    • getPacketID

      public int getPacketID()
      Gets the packet ID for this chat message type.
      Returns:
      the packet ID
    • fromPacketID

      @NotNull public static @NotNull ChatMessageType fromPacketID(int id)
      Gets a chat message type from a packet ID.
      Parameters:
      id - the packet ID
      Returns:
      the chat message type