CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
An interface representing that the argument can be previewed using Minecraft's chat preview feature. More...
Public Member Functions | |
T | withPreview (PreviewableFunction< A > preview) |
Sets the PreviewableFunction for this argument. More... | |
Optional< PreviewableFunction< A > > | getPreview () |
T | usePreview (boolean usePreview) |
Whether this argument should use the preview result as the argument value for execution. More... | |
boolean | isLegacy () |
An interface representing that the argument can be previewed using Minecraft's chat preview feature.
To use this, the server must have previews-chat=true
set in its server.properties
file
Optional< PreviewableFunction< A > > dev.jorel.commandapi.arguments.Previewable< T, A >.getPreview | ( | ) |
PreviewableFunction
for this argument, as an Optional
. boolean dev.jorel.commandapi.arguments.Previewable< T, A >.isLegacy | ( | ) |
T dev.jorel.commandapi.arguments.Previewable< T, A >.usePreview | ( | boolean | usePreview | ) |
Whether this argument should use the preview result as the argument value for execution.
If set to true, accessing this argument in args
will return the same value generated from Previewable#withPreview(PreviewableFunction)
usePreview | whether to use the preview as the value for this argument |
T dev.jorel.commandapi.arguments.Previewable< T, A >.withPreview | ( | PreviewableFunction< A > | preview | ) |
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.
preview | the function to use for chat preview generation |