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.
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
Video Example
Last updated