ChatUtils

object ChatUtils

A collection of utility functions for creating and sending or displaying chat messages.

Use chatMessage to put messages in chat which are only visible locally and are not sent to the server.

Use modMessage for client side messages in chat that start with mods chat prefix.

Use sendChat for sending a player message to the server.

Use command to execute commands either client side or send them to the server.

Author

Aton

Functions

Link copied to clipboard
fun chatMessage(iChatComponent: IChatComponent)
fun chatMessage(text: String, reformat: Boolean = true)

Print a message in chat client side.

Link copied to clipboard
fun command(text: String, clientSide: Boolean = true)

Runs the specified command. Per default sends it to the server but has client side option. The input is assumed to not include the slash "/" that signals a command.

Link copied to clipboard
fun createHoverableText(text: String, hoverText: String): IChatComponent

Creates a new IChatComponent displaying text and showing hoverText when it is hovered. hoverText can include "\n" for new lines.

Link copied to clipboard
fun modMessage(iChatComponent: IChatComponent)
fun modMessage(text: String, reformat: Boolean = true)

Puts a message in chat client side with the mod prefix.

Link copied to clipboard
fun sendChat(message: String)

Send player message to the server.

Link copied to clipboard

Remove control codes from the receiver with the vanilla function for it.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val RED: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard