The TextPrompt.Clickable-Cancel option enables clickable cancel functionality in the TextPrompt feature.
Usage
You can configure the TextPrompt.Clickable-Cancel by editing the "prompt-config.yml" file as follows:
TextPrompt:
Clickable-Cancel: true
In this example, the clickable cancel functionality is enabled.
Explanation
The TextPrompt.Clickable-Cancel option allows you to provide users with the ability to cancel command completion through a clickable option. Enabling this feature can enhance user interaction and make the cancellation process more convenient.
Example
To disable the clickable cancel functionality, use the following configuration:
This will disable the clickable cancel option.
TextPrompt:
Clickable-Cancel: false
Welcome
Welcome to the official documentation for CommandPrompter! This documentation is designed to provide comprehensive guidance on configuring and utilizing the CommandPrompter plugin effectively.
About CommandPrompter
CommandPrompter is a powerful tool that enhances the command prompting experience in your Minecraft server. With its customizable configuration options, CommandPrompter allows you to tailor the command prompting process to suit your server's specific requirements.
Need Further Assistance?
If you encounter any issues or require additional assistance that isn't covered in this documentation, please don't hesitate to join our Discord server, where our friendly community is ready to help you out. Click the link below to join:
Further Documentation
If you can't find the information you're looking for in this GitBook, please check the for additional resources and support.
We hope you find this documentation helpful in maximizing the potential of the CommandPrompter plugin for your Minecraft server!
Support the Development
Love using CommandPrompter? Support its growth and future development on Ko-fi, and be a part of shaping the next level of menu creation and command interactivity for your server! You will also get a special supporter role on the Discord server!
Prompt Arguments are only within the scope of a specific Prompt. Therefore, an argument will only modify how a specific prompt behaves.
Example:
/nick <Who do you want to change the nickname of?> <-ds -a what nick name do you want?>
For the command shown above, we can see that the first Prompt <Who do you want to change the nickname of?> does not have any argument at all. However, the second prompt <-ds -a what nickname do you want?> has two Prompt arguments: -ds and -a. These two arguments are considered as a Prompt Argument since it will only modify the current prompt. -ds disables the input sanitation for that current prompt only. Disabling input sanitation allows for the to be kept since by default, CommandPrompter’s input processing removes them. The argument -a changes that prompt to become an .
CommandPrompter has two type of arguments, Prompt and PromptQueue arguments.
Prompt and PromptQueue arguments are special sets of characters starting with a - and ending with a space that you put on a prompt to change how the prompt or the whole command behaves.
Installation
Installation
Download the latest version of CommandPrompter on SpigotMC
Drag and drop the downloaded .jar file into your server's plugins folder.
A prompt can have multiple arguments (except for prompt arguments). This allows you to disable sanitation, enable input validation, and assign permission attachments, in a single prompt.
Here is the list of all arguments that you can use so far:
Argument Name
Key
Scope
Description
Input Validation
iv:<alias>
Prompt
Validate an input for a certain prompt.
Post Command
exa:<tick delay>
PromptQueue
Add a command to execute after completion.
Post Command on Cancel
exac:<tick delay>
PromptQueue
Add a command to execute after completion is cancelled.
CommandPrompter intercepts all of the commands that are being executed by players. If one of the commands contains Prompt(s) (by default it is signified with a <>, but could be changed in the configuration.) CommandPrompter will then cancel that command and prompt the player with whatever that prompt was. When all prompts have been resolved, CommandPrompter will then allow the player to execute the full command.
from v2.5.0, you can now also use the Console Delegate command to prompt target players
Additional Prompt Option
An additional argument that you append at the beginning of the prompt changes the type of that prompt. By default, a prompt without an argument is going to be a Text Prompt. However, if we append the argument -a (with a space), the prompt becomes an Anvil Prompt. To see all of the available prompt types, check out the Prompts group on the sidebar. To learn more about Arguments check
Example
Commands and Permissions
Commands
Command
Alias
Description
Permission
reload
All commands with the exception of consoledelegate are sub-commands of commandprompter (cmdp). Therefore if you want to reload your configuration, you would need to do /cmdp reload
Permissions
Permission
Description
Prompt-Prefix
The Prompt-Prefix option allows you to set a custom prefix for CommandPrompter's PluginMessenger.
Usage
You can configure the Prompt-Prefix by editing the "config.yml" file as follows:
# Set the plugin prefix
Prompt-Prefix: '[&3Prompter&r] '
In this example, the prefix is set to [&3Prompter&r].
Explanation
The Prompt-Prefix is a string that appears before prompts when using the CommandPrompter plugin. It's customizable to match your server's branding or style.
Example
You can set the Prompt-Prefix to your server's name like this:
This will display prompts with the prefix "[MyServer]".
Prompt-Timeout
The Prompt-Timeout option allows you to specify the duration, in seconds, until CommandPrompter cancels a prompt.
Usage
You can configure the Prompt-Timeout by editing the "config.yml" file as follows:
commandprompter.playerdelegate
Permission just to hide the player delegate command from players.
r
Reloads command prompter.
commandprompter.reload
cancel
c
Cancels command completion for command sender
commandprompter.cancel
rebuildheadcache
none
Command to rebuild Player UI's head cache.
commandprompter.rebuildheadcache
consoledelegate
none
Command for console delegate. This is not a CommandPrompter subcommand.
commandprompter.consoledelegate
playerdelegate
none
Command for player delegate. This is not a CommandPrompter subcommand
commandpromtper.consoledelegate
commandprompter.reload
Allows a player to reload CommandPrompter.
commandprompter.cancel
Allows a player to cancel their own command completion.
commandprompter.use
Allows a player to use CommandPrompter. (must be enabled)
commandprompter.rebuildheadcache
Allows a player to rebuild the head cache for Player UI.
commandprompter.consoledelegate
Permission just to hide the console delegate command from players.
Welcome to the configuration guide for CommandPrompter. The following sub-pages will help you understand the various configuration options available in the "config.yml" file.
config.yml doesn't allow you to configure prompts. However, you can configure prompt-config.yml. Please refer toPrompts Configurationto learn more
Text Prompt:
Player: /command <prompt 1> <prompt 2>
CommandPrompter: prompt 1
Player: answer1
CommandPrompter: prompt 2
Player: answer2
Now that the command completion is done, CommandPrompter will now execute the following command:
/command answer1 answer2
Anvil Prompt:
Player: /command <-a prompt>
CommandPrompter: opens anvil gui for player.
Player: types "answer1" on the anvil.
Now that the command completion is done, CommandPrompter will now execute the following command:
/command answer1
In this example, the timeout is set to 300 seconds.
Explanation
The Prompt-Timeout determines the period of inactivity after which CommandPrompter cancels a prompt. Adjust this value to control how long a user has to input a command before the prompt is canceled automatically.
Example
To set the Prompt-Timeout to 120 seconds, use the following configuration:
This will set the timeout to 120 seconds, allowing users two minutes to respond to a prompt.
# After how many seconds until
# CommandPrompter cancels a
# prompt
Prompt-Timeout: 300
Prompt-Timeout: 120
Update-Checker
The Update-Checker option determines whether CommandPrompter can check if it's up to date.
Usage
You can configure the Update-Checker by editing the "config.yml" file as follows:
# Allow CommandPrompter to
# check if it's up to date.
Update-Checker: true
In this example, the update checker is enabled (true).
Explanation
Enabling the Update-Checker option allows CommandPrompter to automatically check whether there are any updates available. When set to true, CommandPrompter can perform version checks and provide notifications if a new version is available.
When a player with OP privileges joins the server, CommandPrompter will send a message to that player if an update is available.
Example
To disable the update checker, use the following configuration:
This will prevent CommandPrompter from checking for updates automatically.
Cancel-Keyword
The Cancel-Keyword option determines the word that cancels command prompting.
Usage
You can configure the Cancel-Keyword by editing the "config.yml" file as follows:
# Word that cancels command
# prompting.
Cancel-Keyword: cancel
In this example, the cancel keyword is set to "cancel".
Explanation
The Cancel-Keyword is the specific word that, when entered by a user, cancels the prompt queue. It provides users with a way to exit out of the prompt queue without executing any command.
Example
To change the cancel keyword to "exit", use the following configuration:
This will set "exit" as the keyword that cancels command prompting.
Enable-Permission
The Enable-Permission option enables permission checks before a player can use the prompting feature.
Usage
You can configure the Enable-Permission by editing the "config.yml" file as follows:
# Enable permission check
# before a player can use
# the prompting feature
Enable-Permission: false
In this example, the permission check is set to false.
Explanation
Enabling the Enable-Permission option allows you to control whether players need specific permissions to use the command prompting feature. When set to true, players must have the required permission to use the command prompting functionality.
Example
To enable permission checks, use the following configuration:
This will enforce permission checks for using the command prompting feature.
Update-Checker: false
Cancel-Keyword: exit
Enable-Permission: true
PromptQueue Argument
PromptQueue Arguments are within the scope of the whole PromptQueue (how a command is represented in CommandPrompter). This type of argument can be placed on any of the prompts and is only needed to be placed once. If placed multiple times, CommandPrompter will still process the argument but will essentially be useless since the first appearance of the argument has already modified the whole PromptQueue.
Example:
/ban <Who do you want to ban?> <What is the reason for the ban?> <-exa broadcast banned p:0>
The last prompt has an argument -exa. This argument is called Post Command, which is essentially a command that will be called after the command is completed and dispatched. This is considered a prompt queue argument because it affects the whole prompt queue itself not just a single prompt.
Ignored-Commands
The Ignored-Commands option allows you to specify a list of commands that CommandPrompter should ignore.
Usage
You can configure the Ignored-Commands by editing the "config.yml" file as follows:
In this example, the commands sampleCommand and sampleCommand2 are ignored by CommandPrompter.
Explanation
The Ignored-Commands option allows you to specify certain commands that CommandPrompter should not process. By listing these commands, you can ensure that CommandPrompter does not interfere with their execution.
VentureChat channels are automatically ignored by CommandPrompter
Example
To add more commands to the list of ignored commands, use the following configuration:
This will include anotherCommand in the list of commands ignored by CommandPrompter.
Adjust the content to fit your documentation style and requirements.
Argument-Regex
The Argument-Regex option determines if a part of a command is a prompt.
Usage
You can configure the Argument-Regex by editing the "config.yml" file as follows:
# This will determine if
# a part of a command is
# a prompt.
#
# ONLY CHANGE THE FIRST AND LAST
# I.E (.*?), {.*?}, or [.*?]
Argument-Regex: <.*?>
In this example, the argument regex is set to <.*?>. Therefore a command with prompts will look like the following:
Explanation
The Argument-Regex allows you to define a pattern that identifies prompts within a command. By customizing this regex, you can specify how CommandPrompter recognizes and handles command arguments as prompts.
To allow for reserved regex tokens like () and [], CommandPrompter escapes the first and last character of this configuration.
Example
To modify the argument regex pattern, use the following configuration:
This will set the argument regex to (.*?) for identifying command prompts.
Debug-Mode
The Debug-Mode option enables debug mode for CommandPrompter.
Usage
You can configure the Debug-Mode by editing the "config.yml" file as follows:
# Enable debug mode for CommandPrompter.
Debug-Mode: true
In this example, debug mode is enabled (true).
Explanation
Enabling the Debug-Mode option allows CommandPrompter to operate in debug mode, which can be useful for troubleshooting and identifying issues. Debug mode provides additional information and logs for developers to diagnose and resolve problems.
Example
To disable debug mode, use the following configuration:
This will deactivate debug mode for CommandPrompter.
Command-Tab-Complete
The Command-Tab-Complete option enables command tab completion for CommandPrompter.
Usage
You can configure the Command-Tab-Complete by editing the "config.yml" file as follows:
# Enable command tab complete
# for CommandPrompter
Command-Tab-Complete: true
In this example, command tab completion is enabled (true).
Explanation
Enabling the Command-Tab-Complete option allows CommandPrompter to provide tab completion functionality for commands. This feature assists users by suggesting or automatically completing commands based on the input provided.
Example
To disable command tab completion, use the following configuration:
This will deactivate command tab completion for CommandPrompter.
Fancy-Logger
The Fancy-Logger option enables a stylish logger for CommandPrompter.
Usage
You can configure the Fancy-Logger by editing the "config.yml" file as follows:
# Enable fancy logger
# Do /commandprompter reload to
# apply the change
Fancy-Logger: true
In this example, the fancy logger is enabled (true).
Explanation
Enabling the Fancy-Logger option allows CommandPrompter to utilize a visually enhanced logger for displaying information. The fancy logger provides a more appealing and user-friendly interface for logging activities related to CommandPrompter.
Example
To disable the fancy logger, use the following configuration:
This will deactivate the fancy logger for CommandPrompter.
Permission-Attachment
The Permission-Attachment configuration involves important settings that require detailed explanation. To better understand how this option works and its implications, please refer to the dedicated page for the Permission-Attachment configuration:
By visiting this page, you will gain insight into the purpose and functionality of the Permission-Attachment configuration in CommandPrompter.
Chat Prompt
Controls the settings for .
Ignore MiniMessage
The Ignore-MiniMessage option allows users to configure whether CommandPrompter ignores MiniMessage syntax when parsing prompts.
Usage
You can customize the Ignore-MiniMessage option by editing the appropriate configuration file, typically named "config.yml" or similar, with the following:
In this example, CommandPrompter is configured to ignore MiniMessage syntax.
Enable-Unsafe and Modification-Delay
These configurations are crucial settings within CommandPrompter that require detailed explanation. To better understand how these options work and their implications, please refer to the dedicated pages for each configuration:
By visiting the page listed above, you will gain insight into the purpose and functionality of the Enable-Unsafe and Modification-Delay configurations in CommandPrompter.
Show-Completed-Command
The Show-Complete-Command option determines whether CommandPrompter should send the completed command to the player before dispatching it.
Usage
You can configure the Show-Complete-Command by editing the "config.yml" file as follows:
Response-Listener-Priority
The TextPrompt.Response-Listener-Priority option allows you to change the priority of the response listener for Chat Prompt.
Usage
You can configure the TextPrompt.Response-Listener-Priority by editing the "prompt-config.yml" file as follows:
# What commands should CommandPrompter ignore
#
# When a command is ignored, CommandPrompter
# will not proceed to check if the command
# contains a prompt.
#
# Do not include the /
#
# VentureChat channels are automatically ignored.
Ignored-Commands:
- sampleCommand
- sampleCommand2
The Ignore-MiniMessage option ensures that CommandPrompter's parser does not mistake MiniMessage syntax for a prompt. This prevents conflicts and allows users to use both CommandPrompter and MiniMessage without interference.
Example
To disable the ignoring of MiniMessage syntax, set the configuration as follows:
This will enable CommandPrompter to parse MiniMessage syntax along with prompts.
Ignore-MiniMessage: true
Ignore-MiniMessage: false
In this example, the option to show the completed command is enabled (true).
Explanation
Enabling the Show-Complete-Command option allows players to view the final form of their command before it is executed. This feature can help prevent mistakes and ensure that the intended command is dispatched accurately.
Example
To disable the display of the completed command, use the following configuration:
This will prevent the completed command from being shown to the player.
# Should CommandPrompter send
# the completed command to the
# player before dispatching it?
Show-Complete-Command: true
In this example, the response listener priority is set to DEFAULT.
Example
To change the response listener priority to a different level, use one of the following values: LOW, LOWEST, NORMAL, HIGH, or HIGHEST in the configuration:
This will set the response listener priority to HIGH.
The Allowed-Commands-In-Prompt option defines a list of commands that CommandPrompter allows when a player executes another command while completing a prompt.
Usage
You can configure the Allowed-Commands-In-Prompt by editing the appropriate configuration file, typically named "config.yml" or similar, with the following:
In this example, the specified commands (sampleCommand, sampleCommand2) are allowed to be executed while completing a prompt.
Explanation
The Allowed-Commands-In-Prompt option is designed to control which commands are permitted when a player is in the process of completing a prompt. This allows users to execute specific commands without canceling the ongoing prompt, enhancing flexibility and user experience.
Example
To add or remove commands from the allowed list, modify the configuration as needed:
This will update the list to allow the execution of newCommand in addition to the existing allowed commands.
Important Notes
Commands listed in Allowed-Commands-In-Prompt should not include the "/" prefix.
Allowed commands that contains prompts will still be blocked.
Prompts Configuration
The prompt-config.yml file contains various configuration options that allow customization and control over the prompts and user interfaces in the CommandPrompter plugin. This configuration file is essential for managing the behavior and appearance of different prompt-related features within the plugin. Below are the key configuration options available in the prompt-config.yml file:
Player UI: Configures the visual aspects and behavior of the .
Cancel-Hover-Message
The TextPrompt.Cancel-Hover-Message option specifies the message to show when a player hovers over the clickable cancel message in the TextPrompt feature.
Usage
You can configure the TextPrompt.Cancel-Hover-Message by editing the "prompt-config.yml" file as follows:
For detailed information on each configuration option and its specific parameters, refer to the individual pages corresponding to each configuration option within the prompt-config.yml file.
Feel free to customize this overview based on your documentation requirements.
In this example, the hover message is set to "Click here to cancel command completion" in gray color.
Explanation
The TextPrompt.Cancel-Hover-Message option allows you to define the message that appears when a player hovers over the clickable cancel message. This message provides additional context or instruction to users regarding the functionality of the cancel option.
Example
To customize the hover message for the cancel option, use the following configuration:
This will display "Press to end completion" in gray color when a player hovers over the clickable cancel message in the.
TextPrompt:
Cancel-Hover-Message: '&7Click here to cancel command completion'
TextPrompt:
Cancel-Hover-Message: '&7Press to end completion'
Size
The PlayerUI.Size option determines the size of the UI for the PlayerUI feature.
Usage
You can configure the PlayerUI.Size by editing the "prompt-config.yml" file as follows:
PlayerUI:
Size: 54
In this example, the size of the UI is set to 54.
This can only be multiples of 9 with 18 being the minimum and 54 being the max.
Explanation
The PlayerUI.Size option allows you to specify the size of the UI for displaying player heads. Adjusting this value determines the number of slots available in the UI layout.
Example
To set the size of the UI to 36, use the following configuration:
This will adjust the size of the UI to have 36 slots.
Feel free to adjust the content as needed to fit your documentation style and requirements.
Cancel-Message
The TextPrompt.Cancel-Message option specifies the clickable text message for canceling command completion in the TextPrompt feature.
Usage
You can configure the TextPrompt.Cancel-Message by editing the "prompt-config.yml" file as follows:
TextPrompt:
Cancel-Message: '&7[&c&l✘&7]'
In this example, the cancel message is set to "[✘]" in red color.
Explanation
The TextPrompt.Cancel-Message option allows you to define the message that appears as the clickable option for canceling command completion. This message provides users with a visual cue to initiate the cancellation process.
Example
To customize the cancel message, use the following configuration:
This will display "[Cancel]" in dark red color as the cancel message.
Sorted
The PlayerUI.Sorted option determines whether the player heads in the PlayerUI feature should be sorted by the name of the players.
Usage
You can configure the PlayerUI.Sorted by editing the "prompt-config.yml" file as follows:
PlayerUI:
Sorted: false
In this example, the player heads are not sorted.
Explanation
The PlayerUI.Sorted option allows you to control whether the player heads should be displayed in a sorted order within the PlayerUI feature. Enabling sorting can help organize the player heads for easier navigation.
Example
To enable sorting for the player heads, use the following configuration:
This will sort the player heads within the PlayerUI feature.
Player UI
Configures the visual aspects and behavior of the Player UI Prompt.
The control items in the PlayerUI feature include the Previous, Next, and Cancel options, each with specific configuration:
Item: Specifies the item displayed for the Previous control.
Custom-Model-Data: Sets the custom model data for the item.
Column: Defines the column in which the Previous control is located.
Text: Displays the text associated with the Cancel control.
Refer to the "prompt-config.yml" file for the specific configurations related to each control item.
Item can only be materials found .
Cache-Delay
The PlayerUI.Cache-Delay option determines the delay in ticks after a player joins before their head gets cached in the PlayerUI feature.
Increasing this value might be helpful when player heads are not showing up on the Player UI.
Empty-Message
The PlayerUI.Empty-Message option specifies the message to be displayed when the head cache is empty in the PlayerUI feature.
Usage
You can configure the PlayerUI.Empty-Message by editing the "prompt-config.yml" file as follows:
Per-World
The PlayerUI.Per-World option determines whether the listed players in the PlayerUI feature should be limited to players within the same world as the PlayerUI user.
Usage
You can configure the PlayerUI.Per-World by editing the "prompt-config.yml" file as follows:
You can configure the PlayerUI.Cache-Delay by editing the "prompt-config.yml" file as follows:
In this example, the cache delay is set to 5 ticks.
Explanation
The PlayerUI.Cache-Delay option controls the duration of the delay before a player's head is cached in the PlayerUI feature after they join the server. Adjusting this value allows you to manage the timing of the caching process.
Example
To set the cache delay to 10 ticks, use the following configuration:
This will delay the caching of a player's head by 10 ticks after they join the server.
PlayerUI:
Cache-Delay: 5
In this example, the empty message is set to "No players found!" in red color.
Explanation
The PlayerUI.Empty-Message option allows you to define the message that appears when there are no players to display in the PlayerUI feature. This message informs users that there are no available players to select.
Example
To customize the empty message, use the following configuration:
This will display the message "There are no online players!" in red color when the head cache is empty.
PlayerUI:
Empty-Message: '&cNo players found!'
PlayerUI:
Empty-Message: '&cThere are no online players!'
In this example, the option to limit the listed players to the same world is disabled.
Explanation
The PlayerUI.Per-World option allows you to control whether the PlayerUI feature should display only the players within the same world as the user accessing the PlayerUI. Enabling this option can help focus the selection on players within the same game environment.
Example
To enable the restriction of listed players to the same world, use the following configuration:
This will limit the listed players to those within the same world as the PlayerUI user.
PlayerUI:
Per-World: false
PlayerUI:
Per-World: true
PlayerUI:
Cache-Delay: 10
Custom-Title
The AnvilGUI.Custom-Title option allows you to set a custom title for the Anvil GUI if the title is enabled.
Usage
You can configure the AnvilGUI.Custom-Title by editing the "prompt-config.yml" file as follows:
AnvilGUI:
Custom-Title: ''
In this example, no custom title is provided.
Explanation
The AnvilGUI.Custom-Title option enables you to define a personalized title for the Anvil GUI when the title is enabled. You can use this feature to provide users with a more descriptive or engaging title that complements the prompt.
Example
To set a custom title for the Anvil GUI, use the following configuration:
This will display "Enter Your Text Here" as the custom title in the Anvil GUI.
Filter-Format
The PlayerUI.Filter-Format option allows users to configure the display format for heads in the Player UI based on different filters.
Usage
You can customize the PlayerUI.Filter-Format by editing prompt-config.yml
In this example, we set the format for both World and Radial. Not all filters will be configured to have a format by default. However, if there are no format defined, it will use the config.
Filters are implemented in code and you can't just add filter format on this configuration. To see the list of available filters please refer to
Explanation
The PlayerUI.Filter-Format option enables users to tailor the display format of heads in the Player UI based on different filters.
Example
To modify the display format for a particular filter, adjust the configuration as needed:
Important Notes
The %s placeholder represents the player's name and will be replaced dynamically in the display format.
Customize the display formats according to your preferences to enhance the visual representation of heads in the Player UI.
Skull-Name-Format
The PlayerUI.Skull-Name-Format option determines the display name format for the player heads in the PlayerUI.
Usage
You can configure the PlayerUI.Skull-Name-Format by editing the "prompt-config.yml" file as follows:
PlayerUI:
Skull-Name-Format: '&6%s'
In this example, the display name format is set to &6%s.
Explanation
The PlayerUI.Skull-Name-Format allows you to define the formatting for the display names associated with player heads in the PlayerUI feature. You can customize this format to enhance the visual appearance of the player heads.
Example
To change the display name format to display in a different color, use the following configuration:
This will display the player heads with names in green color.
Enable-Title
The AnvilGUI.Enable-Title option determines whether to show the first line of the prompt (if with {br}) as the title of the Anvil GUI.
Usage
You can configure the AnvilGUI.Enable-Title by editing the "prompt-config.yml" file as follows:
AnvilGUI:
Enable-Title: true
In this example, the option to enable the title is set to true.
Explanation
The AnvilGUI.Enable-Title option allows you to control whether the first line of the prompt is displayed as the title in the Anvil GUI. Enabling this option can provide users with a clearer context for their input within the Anvil GUI.
Example
To disable the display of the first line of the prompt as the title, use the following configuration:
This will prevent the first line of the prompt from being shown as the title in the Anvil GUI.
Skull Custom Model Data
Skull Custom Model Data Configuration
The Skull-Custom-Model-Data option allows server managers to set a custom model data for the player heads that appear under the PlayerUI.
Usage
You can configure the Skull-Custom-Model-Data option by editing the appropriate configuration file, typically named "prompt-config.yml" or similar, with the following:
In this example, the custom model data for player heads is set to 0.
Explanation
The Skull-Custom-Model-Data option enables server managers to customize the appearance of player heads displayed under the PlayerUI by setting a custom model data. This allows for unique visual representations of player heads within the user interface.
Example
To modify the custom model data for player heads, adjust the configuration as needed:
This will set the custom model data for player heads to 123 within the PlayerUI.
Input-Field-Location
The SignUI.Input-Field-Location option specifies the line from which the answer should be read in the Sign UI feature.
Usage
You can configure the SignUI.Input-Field-Location by editing the "prompt-config.yml" file as follows:
SignUI:
Input-Field-Location: bottom
In this example, the input field is set to be read from the bottom line of the sign.
Explanation
The SignUI.Input-Field-Location option determines the specific line on the sign that should be considered as the input field. This setting helps identify where the user's response will be located within the Sign UI feature.
Example
To change the input field location to a different line, use one of the following values: top, top-aggregate, bottom, or bottom-aggregate in the configuration:
This will set the input field location to the top line of the sign in the Sign UI feature.
Prompt-Message
The AnvilGUI.Prompt-Message option specifies the message to be displayed on the Anvil GUI
Usage
You can configure the AnvilGUI.Prompt-Message by editing the "prompt-config.yml" file as follows:
AnvilGUI:
Prompt-Message: ''
In this example, no prompt message is provided.
Explanation
The AnvilGUI.Prompt-Message option allows you to define a message that provides guidance or instructions for users within the Anvil GUI. You can use this message to prompt users on what type of input is expected or guide them through the input process.
Example
To set a prompt message for the Anvil GUI, use the following configuration:
This will display "Please enter your text here:" as the prompt message in the Anvil GUI.
Internationalization (I18N)
This supports UTF-8 encoding
The CommandPrompter.properties file contains key-value pairs for configuring various messages and prompts used within the CommandPrompter plugin. These messages cover a range of interactions, including prompts, command completions, error messages, and more. Below are some of the notable properties defined in the file:
Item
The AnvilGUI.Item option specifies the item to be placed on the Anvil GUI.
Can only be materials found .
Chat Prompt
A text prompt is the most basic prompt type for CommandPrompter. It simply uses chat to get answers from the player.
Text Prompt
Sign UI
Defines the configuration for the .
Cache-Size
The PlayerUI.Cache-Size option determines the size of the head cache in the PlayerUI feature.
Usage
You can configure the PlayerUI.Cache-Size by editing the "prompt-config.yml" file as follows:
Material
The SignUI.Material option specifies the material used for the signs in the Sign UI feature.
Usage
You can configure the SignUI.Material by editing the appropriate configuration file, typically named "config.yml" or similar, with the following:
PromptInProgress: Message displayed when a user is still in the process of completing a command, providing an option to cancel. The %s placeholder represents the command that can be typed to cancel the prompt.
SignPromptMultiArg: Message indicating a multi-argument sign prompt, instructing the user to type their response after a specific indicator.
SignPromptReminder: Message guiding users during a sign prompt, informing them that each line they input will be combined into a single response.
CompletedCommand: Message confirming the command that will be executed. The %s placeholder represents the actual command that will be executed.
PromptNoPerm: Message displayed when a user lacks the necessary permission to use CommandPrompter.
PromptPlayerOnly: Message indicating that CommandPrompter can only be used by players.
PromptCancel: Message notifying users when command completion is cancelled.
CommandCancelNotInCompletion: Error message indicating that the user is not in the command completion process.
DelegateInvalidArgs: Error message for invalid arguments in a console delegate command.
DelegateUsage: Usage message for a console delegate command. The %s placeholder represents the command's usage.
DelegateInvalidPlayer: Error message for a console delegate command when the specified player is not online. The %s placeholder represents the player's name.
DelegateConsoleOnly: Error message indicating that a command can only be executed by the console.
PluginVersion: Message displaying the installed version of the CommandPrompter plugin. The %s placeholder represents the version number.
PCMOutOfBounds: Error message for when an prompt index for a Post Command is out of bounds of the valid prompt answers.
These properties allow for easy customization of messages and prompts, tailoring the user experience within the CommandPrompter.
AnvilGUI:
Prompt-Message: 'Please enter your text here:'
Usage
You can configure the AnvilGUI.Item by editing the "prompt-config.yml" file as follows:
In this example, the item on the Anvil GUI is set to Paper with a custom model data of 0.
Explanation
The AnvilGUI.Item option allows you to define the specific item that appears on the Anvil GUI. You can customize the material and additional properties, such as custom model data, to enhance the visual representation of the item for users.
Example
To change the item on the Anvil GUI to a different material with custom model data, use the following configuration:
This will display a Diamond item with custom model data 123 on the Anvil GUI.
In this example, the head cache size is set to 256.
Explanation
The PlayerUI.Cache-Size option specifies the maximum number of player heads that can be stored in the cache. Adjusting this value allows you to control the capacity of the cache to accommodate the desired number of player heads.
Example
To set the cache size to 128, use the following configuration:
This will limit the head cache to store a maximum of 128 player heads.
PlayerUI:
Cache-Size: 256
PlayerUI:
Cache-Size: 128
In this example, the material for signs is set to OAK_SIGN.
Explanation
The SignUI.Material option allows you to define the material used for signs within the Sign UI feature. The specified material determines the appearance of the signs during user interactions.
Example
To change the material for signs to a different type, update the configuration as follows:
This will set the material for signs to SPRUCE_SIGN within the Sign UI feature.
Valid Materials
The value assigned to SignUI.Material should match a valid Minecraft material, typically containing the word "SIGN." Common examples include OAK_SIGN, BIRCH_SIGN, ACACIA_SIGN, and more.
Refer to the Minecraft Materials documentation for a comprehensive list of available materials.
The AnvilGUI.Enchanted option determines whether the item on the Anvil GUI should be displayed as enchanted.
Usage
You can configure the AnvilGUI.Enchanted by editing the "prompt-config.yml" file as follows:
AnvilGUI:
Enchanted: false
In this example, the item on the Anvil GUI is not displayed as enchanted.
Explanation
The AnvilGUI.Enchanted option allows you to control whether the item should appear as enchanted on the Anvil GUI. Enabling this option can add a visually enhanced effect to the item, providing a more distinct appearance for users.
Example
To display the item on the Anvil GUI as enchanted, use the following configuration:
This will present the item on the Anvil GUI with an enchanted visual effect.
Sign UI Prompt
Sign UI is a new addition that was introduced on Project Secundum and was only tested on 1.17+ versions of Minecraft.
SignUI Prompt
Prompt Argument
-s (space after is required)
Break lines
Yes
Color Support
Notable feature (Subject to change)
Two types: Single Argument and Multi Argument
Single Argument: A single argument SignUI prompt is the default type. It will simply put the prompt on the very first line of the sign and will combine every following line into one (separated by spaces).
Example
The examples below shows the command with a prompt and a corresponding image of its appearance
Single Argument:
Multi Argument:
Let's say I typed add and 1600, the command to dispatch is going to be /time add 1600
Player UI Prompt
The player UI prompt uses the native inventory interface and places all of the online players into it to allow players to select a player.
PlayerUI Prompt
Prompt Argument
-p:<filter> (space after is required)
Break lines
No
Color Support
Yes, UI colors configuration can be found in prompt-config.yml
Filters
Filters are used to filter out player heads from the Player UI. You also have the ability to customize the head's display by changing its format in the name depending on the filter.
Available filters so far:
Filter
Key
Description
additional filters will be added in the future
You can combine filters. So if you want to mix radial and world filter you can have the following filter wr10 or `r10w`. The format of the filter that comes first will be used.
Example
The example below shows the command with a prompt and a corresponding image of its appearance
Video example:
Permission Attachment
Starting v2.7.0, this feature can only now be used through the Player Delegate command.
If you want to execute commands as a console refer to Console Delegate.
Permission attachments allow players to have temporary access to command permissions. It's only available via player delegate to prevent a vulnerability when it's used as a prompt queue argument.
How to use Permission Attachment
The general idea is to give players a set of permissions that you define in a very short amount of time. This permission set and the duration can be found and configured in config.yml under the Permission Attachment section.
Step 1: Configuring permissions
With the given configuration above, we defined a permission attachment called GAMEMODE to attach gamemode-related permission.
It's important that you only give permissions that you are willing to give to your players. I advise against putting permissions that allow your server to be compromised!
Step 2: Using permission attachments in a prompt
To use the permission attachment, we need to use it via the like the following:
Once the player fulfilled the prompt, CommandPrompter will attach the permissions defined under GAMEMODE and dispatch the command, and remove the attached permissions afterward.
Anvil UI Prompt
As the name suggests, anvil prompt uses the native anvil interface to prompt the player.
Anvil Prompt
Post Command
CommandPrompter now allows you to add a command to execute after all of the prompts have been completed, called PostCommand
Examples below are in the context of a player. If you're using , the commands will be sent as console, making some commands have the wrong arguments. Adjust your command arguments respectively.
Input Validation
CommandPrompter's input validation uses regex to check for the input. To use it, you have to define an input validator in the prompt-config.ym under the key Input-Validation and use it as a prompt argument for your prompt
Input Validator
Player Delegate
The player delegate command is derived from the feature. That means this command can only be called from the console.
The only difference is the format of the command (which requires an additional ), and after prompt completion, the completed command is executed as a player, not a console.
The Player Delegate Command
As I've mentioned before, this command can only be executed through the console. However, it's important to note that the completed command will be executed by the player.
Console Delegate
Console Delegate is the only way to prompt a player and execute the finalized command as the console.
We can think of this feature as a new way to invoke the core part of CommandPrompter, the prompting feature. Instead of intercepting a command executed by a player, we can simply call the Console Delegate command, provide a target player, and the command you want that target player to fulfill.
A PostCommand is an assignable PromptQueueArgument with the key -exa , which stands for execute after, which tells the parser to add a command that the plugin is going to execute after all of the prompts have been completed.
Here is an example:
This should execute the command /say hello world! after completion.
Placeholders
An additional feature is the ability to put placeholders if you want to use one of the answers from the prompts. The placeholder format is p:<index>. Since I'm using the index, the index of the first prompt will always be 0.
Let's say, I enter Hello World! on the text prompt, the command to execute at the end should be /say Hello World!
Multiple Post Command
Another feature available starting from 2.3.0 is the ability to have more than one Post Command. Here's an example of this.
The main command is /time set however, we have three post commands that also clear the weather and broadcast that the time and weather have been changed.
Delayed Post Command
You can add a tick delay for a post command by adding a :<ticks> after the exa
With the example above, we ask which player to give the operator to. But after 100 ticks (5 seconds), we remove that operator status from that player.
Post Command on completion cancel
This is another useful feature when you want to execute a command when the player cancels the command completion. This gives you the ability to reopen another menu if the prompt is canceled.
The example above will re-open the punish menu if the anvil prompt gets canceled.
Piping Post Command to a different executor
To prevent regular (non-op) players from abusing this system through chat, post command piping will only work if the command sender is the console; therefore, you have to use PlayerDelegate or ConsoleDelegate.
For instances where you need the post command to have a different command executor, you can do so by piping them to a different executor.
Format:
Example:
With the example above, the console delegates the prompt to the target_player and once the command is done, target_player will say "I am now [gamemode]".
An input validator could have any key. But under that key, there must be an Alias and at least oneInput Validation. There's also an optional key that you can set called Err-Message. The following is an example of input validators that's included with CommandPrompter by default.
Validators
Validator
Key
Description
Regex
Regex
validates an input by checking if it matches the defined regular expression
Online Player
Online-Player
validates an input by checking if it's a username of one of the online players
Usage
Once you have input validators defined, you can use them by using the prompt argument -iv:<validator alias>. For example:
Since it's a prompt argument, it won't affect other prompt's input validation so you can have something like the following:
If it doesn't pass the regex test, the plugin sends the error message and sends the prompt again.
To learn more about regular expressions click here
Usage
The player delegate command has the following format:
The last part of the command is a greedy argument, therefore anything past the permission attachment will be considered as a command.
Permission attachments are user-defined, however, if you don't want to use any, you can just pass NONE as the permission attachment.
# Permission Attachment Config
#
# Permission attachments allow players
# to have temporary permissions.
#
# ticks - Set how long (in ticks) should the
# permission attachment persist.
#
# permissions - permissions to temporarily
# attach to the players.
Permission-Attachment:
ticks: 1
Permissions:
GAMEMODE:
- bukkit.command.gamemode
- essentials.gamemode
- essentials.gamemode.survival
- essentials.gamemode.creative
playerdelegate CyR1en GAMEMODE gamemode <what gamemode do you want?>
/sampleCommand <this is a text prompt> <-exa say hello world!>
/sampleCommand <what do you want to say> <-exa say p:0>
/time set <enter time to set> <-exa broadcast Time set to &cp:0> <-exa weather clear> <-exa broadcast Weather cleared!>
/op <-p who do you want to op?> <-exa:100 deop p:0>
/mute <-a who do you want to mute?> <-exac:20 punish>
-exa(c):<delay>|p
-exa(c):<delay>|c -> PCM as Console
[console]consoledelegate %target_player% gamemode <what gamemode do you want> %target_player% <-exa|p say I am now p:0>
Input-Validation:
Integer-Sample:
Alias: is
Regex: '^\d+'
Err-Message: '&cPlease enter a valid integer!'
Alpha-Sample:
Alias: as
Regex: '[A-Za-z ]+'
Err-Message: '&cInput must only consist letters of the alphabet!'
Online-Validator:
Alias: ov
Online-Player: true
Err-Message: '&cThat player is not online!`
The example below shows the command with a prompt and a corresponding image of its appearance
Prompt Argument
-a (space after is required)
Break lines
Yes, {br} signifies a break-line and CommandPrompter will put every line (except the first one, since it's the title/item display name) and make them as the item's lore.
Due to how CommandPrompter works, we can't simply allow completed commands to be executed beyond the permission of the player who's calling that command. This is because CommandPrompter listens to player commands and if they have a PromptQueue argument that augments the whole PromptQueue to be dispatched as console, it leads to a very exploitable vulnerability. This essentially boils down to the fact that we cannot control what the player inputs as a command.
However, with the new console delegate command, we can instead delegate the prompting to a target player . Once the command is completed, it's then sent back to the console to be executed as the console, not the player.
The Console Delegate Command
As I've mentioned before, this command can only be called from the console. However, there's still a permission (commandprompter.consoledelegate) associated with this command to make sure that it does not appear in the player's tab complete without that permission.
Players with OP will be able to see the /consoledelegate command on their tab complete. However, CommandPrompter will not process the console delegate command if the sender instance is not ConsoleSender.
Usage
The console delegate command has the following format:
The last part of this argument is a greedy argument. Therefore, everything past the first argument which is the target player will be combined into one string and be considered as a command. This command will then be parsed and featuresdelegated to the target player to be completed.
You can also use the placeholder %target_player% somewhere in your command to replace it with your actual target player.
Example
Here, we are using the default gamemode command and we're delegating the prompt to the player CyR1en. Let's say the player inputted creative, the completed command that will be executed by the console is:
Example with PostCommand
We can also take advantage of CommandPrompter's feature like PostCommand.
The command above will be executed like the first example. However, we have a post command that executes the following command:
Post Command for Console Delegate will also be executed as the console