> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/ui/messages.md).

# Messages

Chat, the scripts console, notifications and the clipboard.

This page covers how to tell the player something or print debug information: through chat, the scripts console, pop-up notifications and the clipboard.

## Chat

With `chat()` you can write to your own chat or send a message to the server. If you just need to print a line without the script label, there is the short `chat(String)`.

```java
chat().print("health: " + player().health());
chat().print("Auction", Text.of("item sold").color(0xFF57D977));
chat().sendToServer("/spawn");
```

| Method                   | Description                                                                                                                      |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `print(message)`         | message with the script name; `Text` is printed with all its styling, anything else through `toString`                           |
| `print(prefix, message)` | the same with your own label                                                                                                     |
| `sendToServer(message)`  | to the server chat, or as a command if the string starts with `/`; goes through the Quick queue, so an open chest will not close |

Everything `print` outputs is only visible to the player. To find out what arrived in chat, subscribe to the `ChatEvent` event, see [Subscribing to events](/en/events/basics.md).

## Log

`log()` writes to the scripts console. It opens with a button in the menu header on the Scripts tab. Quick also writes there how a script loaded, when it was enabled and what errors happened in it. The AI agent reads this console too, through `console_read`.

| Method                  | Description                                                   |
| ----------------------- | ------------------------------------------------------------- |
| `info(message)`         | regular line                                                  |
| `warn(message)`         | warning                                                       |
| `error(message)`        | error                                                         |
| `error(message, cause)` | error with a cause; the full stack trace goes to the game log |

Every line shows the script name and the time. You can pin the console window, then it will not close together with the menu.

## Notifications

| Method                     | Description          |
| -------------------------- | -------------------- |
| `info(message, millis)`    | regular notification |
| `success(message, millis)` | green                |
| `warning(message, millis)` | yellow               |
| `error(message, millis)`   | red                  |

`millis` sets how many milliseconds the notification stays on screen.

## Clipboard

`clipboard().read()` returns the text from the clipboard, or an empty string if it is empty. `clipboard().write(text)` puts text into the clipboard. Every read is written to the console, so you can always see which script accessed the clipboard.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/ui/messages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
