CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.ChatArgument Class Reference

An argument that represents chat with entity selectors. More...

+ Inheritance diagram for dev.jorel.commandapi.arguments.ChatArgument:

Public Member Functions

 ChatArgument (String nodeName)
 Constructs a Chat argument with a given node name. More...
 
Class< BaseComponent[]> getPrimitiveType ()
 
CommandAPIArgumentType getArgumentType ()
 
ChatArgument withPreview (PreviewableFunction< BaseComponent[]> preview)
 
Optional< PreviewableFunction< BaseComponent[]> > getPreview ()
 
boolean isLegacy ()
 
ChatArgument usePreview (boolean usePreview)
 
Argument< T > instance ()
 Returns the instance of this class with the class Impl. More...
 
withPreview (PreviewableFunction< A > preview)
 Sets the PreviewableFunction for this argument. More...
 

Detailed Description

An argument that represents chat with entity selectors.

Since
3.0

@apiNote Returns a BaseComponent[] object

Constructor & Destructor Documentation

◆ ChatArgument()

dev.jorel.commandapi.arguments.ChatArgument.ChatArgument ( String  nodeName)

Constructs a Chat argument with a given node name.

Represents fancy greedy strings that can parse entity selectors

Parameters
nodeNamethe name of the node for argument

Member Function Documentation

◆ instance()

Argument< T > dev.jorel.commandapi.arguments.Argument< T >.instance ( )
inherited

Returns the instance of this class with the class Impl.

Used for chaining builder methods.

◆ withPreview()

T dev.jorel.commandapi.arguments.Previewable< T, A >.withPreview ( PreviewableFunction< A >  preview)
inherited

Sets the PreviewableFunction for this argument.

This function will run when a player requests a chat preview from the server. The function's PreviewInfo will be populated based on the input for the relevant player that requests the chat preview.

Parameters
previewthe function to use for chat preview generation
Returns
the current argument