Skip to content

Tab completing custom commands

TheIntolerant edited this page Nov 22, 2022 · 14 revisions

Thanks to @TheIntolerant, for this tutorial!

Making your custom commands show via tab-completion is complex to do and would require ChatControl to register the commands, which it does not, in order for it to work with tab-completion.

Here I will show three ways to make custom commands work in tab completion. Please note that for commands to start working via tab completion, a full server restart is required after making these changes.


Example: To make a short admin chat command "/ach" that can be tabbed, you can do this three ways.


Option 1) Only use "commands.yml" to make a command alias.

commands.yml setup shown here.
command-block-overrides: []
ignore-vanilla-permissions: false
aliases:
  ach:
  - channel send admin $1-

NOTE: Using commands.yml to make this alias, will mean the command isn't togglable, instead it will work as follows /ach <message> to send a message to the admin channel.


Option 2) Use ChatControl rules AND "commands.yml"

Here, the command we are making is a toggle command for the admin channel - /ach

  1. commands.yml setup shown here

The command here has to be a real command otherwise this won't work!

command-block-overrides: []
ignore-vanilla-permissions: false
aliases:
  ach:
  - say fake alias

Note: "/say fake alias" will get overwritten by chatcontrol!

  1. ChatControl rules - commanads.rs setup**
# This rule only executes when the player 
# is not in the admin channel for reading.
match ^(\/ach)\b
dont verbose
ignore channel admin write
then command channel join admin write
then deny

# This rule only executes when the player
# is in the admin channel for writing.
match ^(\/ach)\b
dont verbose
require channel admin write
then command channel join standard write
then deny

Due to the then deny operator, the alias in commands.yml won't ever execute the "/say" command you put in there. Since ChatControl will deny it if you add then deny inside the ChatControl rule.

NOTE: To make commands work with tab-completion using commands.yml the alias NEEDS to be created for a command that already works with tab-completion. That is why /say is used in this example as that is a vanilla command in Minecraft itself.


Option 3) Use a third-party plugin, which can "register commands" or create "custom commands".

In most cases, these plugins should register the commands making them work with tab completion! However, it will be up to you to work out if a plugin does this or not by testing it yourself.

For example, CustomCommands. Please note, this is developed by someone else! If you need help you will need to contact them!

Clone this wiki locally