# Command Types

<details>

<summary>Alert</summary>

{% code title="Example" %}

```yaml
alert:
  type: "alert"
  enabled: true
  name: "alert"
  permission: "leaf.alert"
  # %message% : The alert message.
  message: "&8&l[&f&lAlert&8&l]&r &a%message%"
```

{% endcode %}

`/[name] [message]`

The alert command type sends a message to all players.

</details>

<details>

<summary>Alert Raw</summary>

<pre class="language-yaml" data-title="Example"><code class="lang-yaml">alertraw:
<strong>  type: "alertraw"
</strong>  enabled: true
  name: "alertraw"
  permission: "leaf.alertraw"
</code></pre>

`/[name] [JSON]`

The alert raw command type sends a `JSON` message to all players.

</details>

<details>

<summary>Chat</summary>

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

```yaml
staffchat:
  type: "chat"
  enabled: true
  name: "staffchat"
  aliases: [ "sc" ]
  permission: "leaf.staffchat"
  # Should the messages be logged in console?
  log: true
  # %message% : The players message.
  format: "{server_formatted}&r {rank_colour}<player>&r &7: {vanish_colour}%message%"
```

{% endcode %}

`/[name] [message]`

The chat command is used to send a message to other players with the same permission.

</details>

<details>

<summary>Find</summary>

{% code title="Example" %}

```yaml
find:
  type: "find"
  enabled: true
  name: "find"
  permission: "leaf.find"
  not_found: "{error_colour}Player could not be found."
  # Placeholders will parse in terms of the player.
  found: "{message} Player was found on {server_formatted}"
  # Let vanishable players find vanishable players?
  vanishable_players: false
```

{% endcode %}

`/[name] [player]`

The find command is used to get information about an online player.

</details>

<details>

<summary>Info</summary>

{% code title="Example" %}

```yaml
info:
  type: "info"
  enabled: true
  name: "leaf"
  message:
    - "&8&m&l-------&r &a&lLeaf &8&m&l-------"
    - "&7"
    - "&7Velocity Proxy Plugin"
    - "&7Version &f<version>"
    - "&7Author &fSmudge"
    - "&7"
    - "&8&m&l--------------------"
```

{% endcode %}

{% code title="Example" %}

```yaml
hello:
  type: "info"
  enabled: true
  name: "hello"
  message: "world"
```

{% endcode %}

`/[name]`

The info command is used to display information.

</details>

<details>

<summary>List</summary>

{% code title="Example" %}

```yaml
stafflist:
  type: "list"
  enable: true
  name: "stafflist"
  permission: "leaf.stafflist"
  header: "&8&m&l-----&r &a&lStaff List &8&m&l-----"
  footer: "&8&m&l--------------------"
  list:
    admin:
      permission: "leaf.rank.admin"
      header: '&7[&f%amount%&7] &c&lAdmins'
      # Placeholders will parse in terms of the player.
      section: '&7- &f<player> {server_formatted}'
```

{% endcode %}

`/[name]`

The list command is used to display a list of online players.

</details>

<details>

<summary>Reload</summary>

{% code title="Example" %}

```yaml
reload:
  type: "reload"
  enabled: true
  name: "leafreload"
  permission: "leaf.reload"
  message: "{message} Reloaded all configs! <3"
  error: "{error_colour}An error occurred and the reloading was aborted!"
```

{% endcode %}

`/[name]`

The reload command is used to reload the `leaf plugin`. Reloading the plugin reloads the configs and re-adds the commands with the new configuration. If you remove a command and reload the plugin, it will be removed from the server.

</details>

<details>

<summary>Report</summary>

<pre class="language-yaml" data-title="Example"><code class="lang-yaml">report:
  type: "report"
<strong>  enable: true
</strong>  name: "report"
  # Who is able to run the command :
  permission: "leaf.report.use"
  # Who is able to see the report :
  see_report: "leaf.report.see"
  # %message% : The players message.
  message: "&#x26;f&#x3C;player> {server_formatted} &#x26;chas reported &#x26;7: &#x26;f%message%"
</code></pre>

`/[name] [message]`

The report command is used to send a message to a group of players.

</details>

<details>

<summary>Send</summary>

{% code title="Example" %}

```yaml
send:
  type: "send"
  enable: true
  name: "send"
  permission: "leaf.send"
  # %from% : From command argument.
  # %to% : To command argument.
  # %amount% : Amount of players successfully sent.
  message: "{message} Sending %from% to %to% &7[&f%amount% &7players]"
  server_not_found: "{error_colour}Server not found."
  server_offline: "{error_colour}Server requested is offline."
```

{% endcode %}

`/[name] [from] [to]`

The send command is used to warp a group of players to a server.

</details>

<details>

<summary>Servers</summary>

{% code title="Example" %}

```yaml
servers:
  type: "servers"
  enable: true
  name: "servers"
  permission: "leaf.servers"
  # The order of how the servers will be displayed.
  order:
    - name_of_a_server
    - testing1
    - testing2
  header: '&8&m&l------&r &a&lServers &8&m&l------'
  # Placeholders registered in context of the server.
  server: '{server_formatted} &f%online% &7Online Players'
  footer: '&8&m&l---------------------'
```

{% endcode %}

`/[name]`

The servers command is used to display the list of online servers.

</details>

<details>

<summary>Mesage</summary>

{% code title="Example" %}

```yaml
message:
  type: "message"
  enable: true
  name: "globalmessage"
  aliases: ["gmsg"]
  not_found: "{error_colour}Player is not online."
  message_self: "{error_colour}You cannot message yourself."
  # Placeholders will parse in terms of the other player.
  to: "&f✉ &7&ome -> &f&o<player> &7&o: &f&o%message%"
  from: "&f✉ &f&o<player> -> &7&ome &7&o: &f&o%message%"
  # Let vanishable players message other vanishable players?
  vanishable_players: false
```

{% endcode %}

`/[name] [player] [message]`

The message command is used to send a message to a specific online player.

</details>

<details>

<summary>Reply</summary>

{% code title="Example" %}

```yaml
reply:
  type: "reply"
  enable: true
  name: "globalreply"
  aliases: [ "gr" ]
  not_found: "{error_colour}You have no conversation to reply to."
  # Placeholders will parse in terms of the other player.
  to: "&f✉ &7&ome -> &f&o<player> &7&o<server> &7&o: &f&o%message%"
  from: "&f✉ &f&o<player> &7&o<server> -> &7&ome &7&o: &f&o%message%"
```

{% endcode %}

`/[name] [message]`

The reply command is used to reply to a previous message.

</details>

<details>

<summary>Ignore</summary>

```yaml
ignore:
    type: "ignore"
    enable: true
    name: "ignore"
    not_found: "{error_colour}Player is not online."
    ignore_self: "{error_colour}You cannot ignore yourself."
    message: "{message} You are now ignoring <player>"
```

`/[name] [player]`

The ignore command is used to ignore other players. This stops them from sending a message to you.

</details>

<details>

<summary>Unignore</summary>

```yaml
unignore:
    type: "unignore"
    enable: true
    name: "unignore"
    not_found: "{error_colour}You are not ignoring this player."
    message: "{message} You are no longer ignoring <player>"
```

`/[name] [player]`

The unignore command is used to remove a player from your ignore list.

</details>

<details>

<summary>Ignore List</summary>

```yaml
ignorelist:
    type: "ignorelist"
    enable: true
    name: "ignorelist"
    message:
      - "&8&m&l------&r &a&lIgnored Players &8&m&l------"
      - "%players%"
      - "&8&m&l---------------------"
```

`/[name]`

The ignore list command is used to display your ignore list.

</details>

<details>

<summary>Toggle Messages</summary>

```yaml
togglemessages:
    type: "togglemessages"
    enable: true
    name: "togglemessages"
    # %toggle% will be replaced with true or false
    message: "{message} Toggled messages %toggle%"
```

`/[name]`

Used to toggle messages. When this is sent to false you can't send or receive messages.

</details>

<details>

<summary>Toggle Spy</summary>

```yaml
togglespy:
    type: "togglespy"
    enable: true
    name: "togglespy"
    permission: "leaf.togglespy"
    # %toggle% will be replaced with true or false
    message: "{message} Toggled spy %toggle%"
```

`/[name]`

Used to toggle spy. When set to true you will be able to see other players' messages.

</details>

<details>

<summary>History</summary>

<pre class="language-yaml" data-title="Example" data-overflow="wrap"><code class="lang-yaml">history:
  type: "history"
  enable: true
  name: "history"
  not_found: "{error_colour}Player could not be found."
  # Amount of sections on a page.
  page_size: 5
  # %page% : The number of the page the player is currently viewing.
  # %page_amount% : The amount of pages they can see.
  header: "&#x26;8&#x26;m&#x26;l------&#x26;r &#x26;a&#x26;l&#x3C;player>''s History &#x26;7[&#x26;f%page%&#x26;7/&#x26;f%page_amount%&#x26;7] &#x26;8&#x26;m&#x26;l------"
  # %event% : The history event.
<strong>  # %server% : The server.
</strong>  # %date% : The date and time it occurred.
  section: '&#x26;7- %event%&#x26;r %server%&#x26;r &#x26;7%date%'
  # %page% : The number of the page the player is currently viewing.
  # %page_amount% : The amount of pages they can see.
  footer: '&#x26;8&#x26;m&#x26;l---------------------'
</code></pre>

`/[name] [player]`

The history command is used to get a player's history from the database. The `dataase.yml` must be enabled.

</details>

<details>

<summary>Message History</summary>

`/[name] [query]`

The message history command is used to get message data from the database.

```
Example: /messagehistory p:Smudge t:10d i:"Hi!" e:"Bye","Byebye"
```

```
Example: /messagehistory p:Smudge,Smudge2 t:1d-2d
```

**Query Types**\
`p:` Is used to include a player or players.\
`t:` Is used to specify a time period.\
`i:` is used to only show message that include the strings.\
`e:` is used to remove messages that include the strings.

```yaml
message_history:
    type: "messagehistory"
    enabled: true
    name: "messagehistory"
    not_found: "{error_colour}Player could not be found."
    # Amount of sections on a page.
    page_size: 8
    # %page% : The number of the page the player is currently viewing.
    # %page_amount% : The amount of pages they can see.
    header: '&8&m&l------&r &a&lMessages &7[&f%page%&7/&f%page_amount%&7] &8&m&l------'
    # %message% : The content of the message.
    # %from% : The player the message was from.
    # %to% :  player the message was sent to.
    # %date% : The date the message was sent.
    section: '&7%date% &f%from% &7: &e%message%'
    # %page% : The number of the page the player is currently viewing.
    # %page_amount% : The amount of pages they can see.
    footer: '&8&m&l---------------------'
```

</details>

<details>

<summary>Inventory</summary>

{% code title="Example" %}

```yaml
inventory:
  type: "inventory"
  enabled: true
  name: "menu"
  inventory:
    size: GENERIC_9X6
    title: "&8&lMenu"
    content:
      "top,bottom":
        material: LIME_STAINED_GLASS_PANE
      "center0":
        skull: "<player>"
        name: "&a&l<player>"
        lore:
          - "&7You are amazing!"
```

{% endcode %}

`/[name]`

The inventory command is used to display an inventory to the player. For more information on inventories [click here](https://smuddgge.gitbook.io/leaf-2.5.0/inventorys).

</details>

<details>

<summary>Teleport</summary>

```yaml
teleport:
  type: "teleport"
  enabled: true
  name: "go"
  not_found: "{error_colour}Player could not be found."
  message: "{message} Teleporting..."
```

`/[name] [player]`

The teleport command is used to teleport to a server a player is connected to.

</details>

<details>

<summary>Join</summary>

```yaml
join:
  type: "join"
  enabled: false
  name: "survival"
  # The name of the server to send the player to.
  server: "survival"
  no_server: "{error_colour}This server is offline"
```

`/[name]`

The join command is used to connect to a server.

</details>

<details>

<summary>Friends</summary>

For more information on friends [click here](https://smuddgge.gitbook.io/leaf-2.5.0/friends).

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

```yaml
friends:
    type: "friends"
    enabled: true
    name: "friends"

    proxy_join: "&8[&a+&8] &7Your friend &a<player> &7joined {server_formatted}"
    proxy_leave: "&8[&c-&8] &7Your friend &c<player> &7left the network"
    server_change: "&8[&e=&8] &7Your friend &e<player> &7switched to {server_formatted}"

    list:
      name: "list"
      enabled: true
      # Lets you see other players friend lists.
      permission_see_any: "leaf.friends.see"
      not_found: "{error_colour}Player could not be found."
      error: "{error_colour}Error occurred when opening inventory."
      # %name% : Formatted name.
      # %date% : Date they started being friends
      # %last_mail% : The last mail that was sent.
      # %mail_status% : If the mail was read or not.
      player:
        skull: "%name%"
        name: "&6&l%name%"
        lore:
          - "&7Friends since %date%"
      no_player:
        material: LIGHT_GRAY_STAINED_GLASS_PANE
      # The inventory displaying the friend list.
      inventory:
        size: GENERIC_9X6
        title: "&8&lFriends List"
        content:
          "top,bottom":
            material: LIME_STAINED_GLASS_PANE
          "row1,row2,row3,row4":
            function:
              type: "player"
          "45":
            function:
              type: "last_page"
              always_show: false
            material: YELLOW_STAINED_GLASS_PANE
            name: "&a&lLast Page"
            lore:
              - "&7Click to go back a page"
          "53":
            function:
              type: "next_page"
              always_show: false
            material: YELLOW_STAINED_GLASS_PANE
            name: "&a&lNext Page"
            lore:
              - "&7Click to go to the next page"


    request:
      name: "request"
      enabled: true
      not_found: "{error_colour}Player has never played on this server."
      requests_off: "{error_colour}This player has there friend requests off."
      self: "{error_colour}You can not be friends with your self."
      # Placeholders will parse in terms of the other player.
      sent: "{message} You have sent a friend request to &f<player>"
      # Placeholders will parse in terms of the player that sent the request.
      from: "{message} You have received a friend request from &f<player>. &aTo accept run the command &e/friends accept"

    accept:
      name: "accept"
      enabled: true
      error: "{error_colour}Error occurred when opening inventory."
      requests_off: "{error_colour}This player has there friend requests off."
      already_requested: "{error_colour}You have already requested to be friends with this player."
      # Placeholders will parse in terms of the player that sent the request.
      # Message is sent to the friend accepter.
      from: "{message} You are now friends with &f<player>"
      # Placeholders will parse in terms of the player that accepted the friend request.
      # Message is sent to the requester.
      sent: "{message} You are now friends with &f<player>"
      # %name% : Formatted name of the player that is requesting.
      player:
        skull: "%name%"
        name: "&6&l%name%"
        lore:
          - "&7Click to open request options."
      no_player:
        material: LIGHT_GRAY_STAINED_GLASS_PANE
      # The inventory displaying the friend requests list.
      inventory:
        size: GENERIC_9X6
        title: "&8&lFriend Requests"
        content:
          "top,bottom":
            material: LIME_STAINED_GLASS_PANE
          "row1,row2,row3,row4":
            function:
              type: "player"
          "45":
            function:
              type: "last_page"
              always_show: false
            material: YELLOW_STAINED_GLASS_PANE
            name: "&a&lLast Page"
            lore:
              - "&7Click to go back a page"
          "53":
            function:
              type: "next_page"
              always_show: false
            material: YELLOW_STAINED_GLASS_PANE
            name: "&a&lNext Page"
            lore:
              - "&7Click to go to the next page"
      options:
        size: GENERIC_9X3
        title: "&8&lFriend Request"
        content:
          "0-2,9-11,18-20":
            function:
              type: "deny"
            material: RED_STAINED_GLASS_PANE
            name: "&c&lDeny"
            lore:
              - "&7Anonymously remove this player"
              - "&7from your requests."
          "6-8,15-17,24-26":
            function:
              type: "accept"
            material: LIME_STAINED_GLASS_PANE
            name: "&a&lAccept"
            lore:
              - "Click to &aaccept &7friend request."

    settings:
      name: "settings"
      enabled: true
      error: "{error_colour}Error occurred when opening inventory."
      inventory:
        size: GENERIC_9X3
        title: "&8&lFriend Requests"
        content:
          "row0,row2":
            material: GRAY_STAINED_GLASS_PANE
          "10":
            function:
              type: "toggleProxyJoin"
              # When true what should the item be overridden with
              true:
                material: LIME_STAINED_GLASS_PANE
            # Default item
            material: RED_STAINED_GLASS_PANE
            name: "&6&lToggle Join Messages"
            lore:
              - "&7Click to toggle join messages"
              - "&6Currently &f%toggleProxyJoin%"
          "11":
            function:
              type: "toggleProxyLeave"
              # When true what should the item be overridden with
              true:
                material: LIME_STAINED_GLASS_PANE
            # Default item
            material: RED_STAINED_GLASS_PANE
            name: "&6&lToggle Leave Messages"
            lore:
              - "&7Click to toggle leave messages"
              - "&6Currently &f%toggleProxyLeave%"
          "12":
            function:
              type: "toggleServerChange"
              # When true what should the item be overridden with
              true:
                material: LIME_STAINED_GLASS_PANE
            # Default item
            material: RED_STAINED_GLASS_PANE
            name: "&6&lToggle Server Change Messages"
            lore:
              - "&7Click to toggle server change messages"
              - "&6Currently &f%toggleServerChange%"
          "15":
            function:
              type: "toggleMail"
              # When true what should the item be overridden with
              true:
                material: LIME_STAINED_GLASS_PANE
            # Default item
            material: RED_STAINED_GLASS_PANE
            name: "&6&lToggle Mail"
            lore:
              - "&7Click to toggle mail"
              - "&6Currently &f%toggleMail%"
          "16":
            function:
              type: "toggleRequests"
              # When true what should the item be overridden with
              true:
                material: LIME_STAINED_GLASS_PANE
            # Default item
            material: RED_STAINED_GLASS_PANE
            name: "&6&lToggle Friend Requests"
            lore:
              - "&7Click to toggle friend requests"
              - "&6Currently &f%toggleRequests%"

    unfriend:
      name: "unfriend"
      enabled: true
      not_found: "{error_colour}Invalid player name."
      # Placeholders will register in terms of the friend.
      message: "{message} You are no longer friends with <player>"
```

{% endcode %}

</details>
