# playerchat

Can be used for `Minecraft -> Discord`

```yaml
player_sent_message:
  # The type of event.
  type: "playerchat"
  
  # [OPTIONAL] Used to enable and disable the event.
  # Defaults to true.
  enabled: false
  
  # [OPTIONAL] Add commands to be run.
  commands:
  - "leaf"
  
  # [OPTIONAL] Add servers to be sent to.
  # If more than 1 server is stated the player will
  # go to the server with the least amount of players
  servers:
  - "hub1"
  - "hub2"
  
  # [OPTIONAL] Add a discord webhook.
  # You can use the placeholder %message% to get the message sent.
  discord_webhook:
    url: "url"
    message:
      username: "<player>"
       avatar: "https://crafatar.com/avatars/<uuid>?overlay"
       message: "%message%"
    embed:
      color: 0x00FF00
      title:
        message: "%message%"
        url: "url"
      description: "Description"
      footer:
        message: "%message%"
        icon: "url"
      author:
        name: "Smudge"
        iconUrl: "url"
        url: "url"
      imageUrl: "url"
      thumbnailUrl: "url"
```


---

# 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/4.4/events/playerchat.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.
