# Friends

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

  # Unlike commands there can only be 1 of each subcommand
  # The type is defined in the key instead of having a type: "subcommand"
  subcommand1: ...
  subcommand2: ...
```

## Friend Subcommands

<details>

<summary>List</summary>

This subcommand is required as the main command `/friends` also runs this subcommand.

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

```yaml
    list:
      name: "list"
      enabled: true
      # %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"
```

{% endcode %}

`/[friends command name] [name]`

The list subcommand displays an inventory containing the list of the player's friends.

</details>

<details>

<summary>Online</summary>

This command displays a inventory full of the players friends that are currently online.

```yaml
online:
      name: "online"
      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"
```

</details>

<details>

<summary>Request</summary>

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

```yaml
request:
      name: "request"
      enabled: true
      not_found: "{error_colour}Player has never played on this server."
      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"
```

{% endcode %}

`/[friends command name] [name] [player]`

The request subcommand is used to send a friend request to a player.

</details>

<details>

<summary>Accept</summary>

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

```yaml
    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."
```

{% endcode %}

`/[friends command name] [name]`

The requests subcommand displays an inventory listing the player's friend requests. When a player is clicked the options menu shows.

</details>

<details>

<summary>Unfriend</summary>

```yaml
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>"
```

`/[friends command name] [name] [player]`

Used to unfriend a player from your friend list.

</details>

<details>

<summary>Settings</summary>

`/[friends command name] [name]`

Shows you global friend settings.

```yaml
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%"
```

</details>

<details>

<summary>Message</summary>

```yaml
message:
      enable: true
      name: "msg"
      not_found: "{error_colour}Player is not online."
      not_friend: "{error_colour}You are not friends with this player."
      message_self: "{error_colour}You cannot message yourself."
      ignoring: "{error_colour}You have ignored this player."
      recipient_ignoring: "{error_colour}This player has ignored you."
      toggled: "{error_colour}You have your messages toggled."
      recipient_toggled: "{error_colour}This player has there messages toggled."
      # 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%"
      # Spy is where other players can see messages.
      spy_format: "&8&o%from% -> %to% : %message%"
```

</details>

<details>

<summary>Reply</summary>

```yaml
reply:
      type: "reply"
      enable: true
      name: "r"
      not_found: "{error_colour}You have no conversation to reply to."
      not_friend: "{error_colour}You are not friends with this player."
      ignoring: "{error_colour}This player is ignoring you."
      toggled: "{error_colour}You have your messages toggled."
      recipient_toggled: "{error_colour}This player has there messages toggled."
      # 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%"
      # Spy is where other players can see messages.
      spy_format: "&8&o%from% -> %to% : %message%"
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smuddgge.gitbook.io/leaf-2.5.0/friends.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
