# Commands

Sounds require the dependency protocolize.

## Command Format

{% code title="Example command" overflow="wrap" %}

```yaml
# [OPTIONAL] → Command Identifier
# You can remove any command from the configuration to disable it.
# The identifier will not affect the command, it can be named anything.
command:

    # [REQUIRED] → Command Type
    # The command type determines how the command will work.
    type: "info"
    
    # [OPTIONAL] → Command Toggle
    # Disable or enable the command.
    # The value defaults to true.
    enabled: true
    
    # [REQUIRED] → Command Name
    # The name of the command, for example:
    # /[name] [arguments]
    name: "name"
    
    # [OPTIONAL] → Command Aliases
    # Every command can have unlimited aliases.
    # Aliases are alternative command names that will execute the same command.
    aliases: ["name2", "name3"]
    
    # [OPTIONAL] → Command Syntax
    # Lets you override the default syntax.
    # The syntax is shown to the player when they input the
    # incorred arguments.
    syntax: "/[name]"

    # [OPTIONAL] → Command Permission
    # Every command can have permission to execute the command.
    # When this is not set, it will default to everyone.
    permission: "leaf.name"
    
    # [OPTIONAL] → Command Requirements
    # Add a permission requirement for different servers.
    require:
      # The requirements identifier.
      # This can be anything.
      "identifier":
        # The required permission.
        permission: "leaf.bypass"
        # The servers that the permission is required on.
        servers:
        - "ServerName"
    
    # [OPTIONAL] → Play Sound
    # Play a sound when the command is executed.
    # Requires the protocolize dependency.
    # Sounds are listed on the sounds page.
    sound: "UI_TOAST_IN"
    
```

{% endcode %}

## Example Command

{% code title="commands.yml" %}

```yaml
#  __         ______     ______     ______
# /\ \       /\  ___\   /\  __ \   /\  ___\
# \ \ \____  \ \  __\   \ \  __ \  \ \  __\
#  \ \_____\  \ \_____\  \ \_\ \_\  \ \_\
#   \/_____/   \/_____/   \/_/\/_/   \/_/
#
# Author : Smudge

commands:
  info:
    type: "info"
    name: "hello"
    # This message will be sent back to the player!
    message: "hello world"
```

{% endcode %}
