Package net.minestom.server.message
Enum Class ChatPosition
- All Implemented Interfaces:
Serializable
,Comparable<ChatPosition>
,Constable
The different positions for chat messages.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA player-initiated chat message.Game state information displayed above the hot bar.Feedback from running a command or other system messages. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ChatPosition
fromMessageType
(@NotNull MessageType messageType) Gets a position from an Adventure message type.static @NotNull ChatPosition
fromPacketID
(int id) Gets a position from a packet ID.byte
getID()
Gets the packet ID of this chat position.@Nullable MessageType
Gets the Adventure message type from this position.static ChatPosition
Returns the enum constant of this class with the specified name.static ChatPosition[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CHAT
A player-initiated chat message. -
SYSTEM_MESSAGE
Feedback from running a command or other system messages. -
GAME_INFO
Game state information displayed above the hot bar.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getMessageType
Gets the Adventure message type from this position. Note that there is no message type forGAME_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
Gets a position from a packet ID.- Parameters:
id
- the id- Returns:
- the chat position
-