Message

class Message

Constructors

Link copied to clipboard
fun Message(event: ClientChatReceivedEvent)

Creates a new Message object from a chat event.

Link copied to clipboard
fun Message(component: MCITextComponent)

Creates a new Message object from an IChatComponent.

Link copied to clipboard
fun Message(messageParts: ArrayList<Any>)

Creates a new Message object in parts of TextComponents or Strings.

Link copied to clipboard
fun Message(vararg components: Any)

Creates a new Message object in parts of TextComponents or Strings.

Functions

Link copied to clipboard
fun actionBar()

Outputs the Message into the client's action bar.

Link copied to clipboard
fun addTextComponent(component: Any): Message

Adds a TextComponent or String to the end of the Message.

fun addTextComponent(index: Int, component: Any): Message

Adds a TextComponent or String at index of the Message.

Link copied to clipboard
fun chat()

Outputs the Message into the client's chat.

Link copied to clipboard
fun clone(): Message
Link copied to clipboard
fun copy(): Message
Link copied to clipboard
fun edit(vararg replacements: Message)

Edits this message (once it is already sent)

Link copied to clipboard
fun getChatLineId(): Int
Link copied to clipboard
fun getChatMessage(): MCITextComponent
Link copied to clipboard
fun getFormattedText(): String
Link copied to clipboard
fun getMessageParts(): List<TextComponent>
Link copied to clipboard
fun getUnformattedText(): String
Link copied to clipboard
fun isFormatted(): Boolean
Link copied to clipboard
fun isRecursive(): Boolean
Link copied to clipboard
fun setChatLineId(id: Int): Message

Sets the chat line ID of the message. Useful for updating an already sent chat message.

Link copied to clipboard
fun setFormatted(formatted: Boolean): Message

Sets if the message is to be formatted

Link copied to clipboard
fun setRecursive(recursive: Boolean): Message

Sets whether the message can trip other triggers.

Link copied to clipboard
fun setTextComponent(index: Int, component: Any): Message

Sets the TextComponent or String in the Message at index.

Link copied to clipboard
open override fun toString(): String

Sources

Link copied to clipboard