Enum Class ChatPosition

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

public enum ChatPosition extends Enum<ChatPosition>
The different positions for chat messages.
  • Enum Constant Details

    • CHAT

      public static final ChatPosition CHAT
      A player-initiated chat message.
    • SYSTEM_MESSAGE

      public static final ChatPosition SYSTEM_MESSAGE
      Feedback from running a command or other system messages.
    • GAME_INFO

      public static final ChatPosition GAME_INFO
      Game state information displayed above the hot bar.
  • Method Details

    • values

      public static ChatPosition[] 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 ChatPosition 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
    • getMessageType

      @Nullable public @Nullable MessageType getMessageType()
      Gets the Adventure message type from this position. Note that there is no message type for GAME_INFO, as Adventure uses the title methods for this.
      Returns:
      the message type, if any
    • getID

      public byte getID()
      Gets the packet ID of this chat position.
      Returns:
      the ID
    • fromMessageType

      @NotNull public static @NotNull ChatPosition fromMessageType(@NotNull @NotNull MessageType messageType)
      Gets a position from an Adventure message type.
      Parameters:
      messageType - the message type
      Returns:
      the position
    • fromPacketID

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