# Messages

{% hint style="danger" %}
To fully understand this documentation, you need to be familiar with how a YAML configuration file works. Without this knowledge, the following explanations may be difficult to follow.
{% endhint %}

You can use the [MiniMessage format](https://docs.advntr.dev/minimessage/index.html) for your messages, which allows you to add extensive customization options and functionality.

Here is a site that allows you to preview your messages: <https://webui.advntr.dev/>

You can also set global variables for all messages in the `config.yml` file, such as `<success>` and `<error>`.

## Configurations

There are various ways to configure the messages, with the most common being a simple message, like this:

```yaml
module-disable: "<error>The &f%name% <error>module is disabled. You cannot use this command."
```

However, there are other types of messages, as well as the ability to send multiple messages simultaneously.

### TCHAT

The `tchat` type is the most common message type, allowing you to send messages directly to the player's chat. With this type, each message will include a prefix. If you want to send a message without a prefix, you must use the [WITHOUT\_PREFIX](#without_prefix) type. Note that when you send a list of messages, only the first message will have a prefix; in the example below, `module-disable` will have a prefix, but `rules` will not.

You have the option to send either a single message or multiple messages, like this:

```yaml
module-disable: "<error>The &f%name% <error>module is disabled. You cannot use this command."
rules:
  - "#ffd353ℹ sᴇʀᴠᴇʀ ʀᴜʟᴇs#3f3f3f:"
  - "#3f3f3f• &7Respect all players and staff."
  - "#3f3f3f• &7No grieging or stealing."
  - "#3f3f3f• &7No cheating or hacking."
  - "#3f3f3f• &7Keep chat clean and respectful."
  - "#3f3f3f• &7No spamming or advertising."
```

You don’t need to specify the type for `tchat`; it will be used by default.

### ACTION

The `action` type allows you to send a message to the player's action bar. You need to specify the type like this:

```yaml
teleport-message:
  type: ACTION
  message: "&7Teleporting in #0EEA93%seconds% &7seconds, you must not move."
```

### WITHOUT\_PREFIX

The `without_prefix` type is used to send a message without a prefix. By default, all messages will include a prefix. To remove the prefix, you need to specify the type like this:

```yaml
command-baltop:
  type: WITHOUT_PREFIX
  message: "#00f986#%position% &f%name%&8: %amount%"
```

### NONE

This type does not send the message.

### CENTER

To send a message that will be centered in your chat, you need to specify the type like this:

```yaml
rules:
  type: CENTER
  messages:
    - "#ffd353ℹ sᴇʀᴠᴇʀ ʀᴜʟᴇs#3f3f3f:"
    - "#3f3f3f• &7Respect all players and staff."
    - "#3f3f3f• &7No grieging or stealing."
    - "#3f3f3f• &7No cheating or hacking."
    - "#3f3f3f• &7Keep chat clean and respectful."
    - "#3f3f3f• &7No spamming or advertising."
```

### BOSSBAR

To create a bossbar, you need to do it like this:

```yaml
example:
  type: BOSSBAR
  text: "BossBar Example"
  color: WHITE
  overlay: PROGRESS
  flags:
    - DARKEN_SCREEN
    - PLAY_BOSS_MUSIC
    - CREATE_WORLD_FOG
  duration: 100 # 100 ticks, 5s
  static: false
```

The bossbar uses the MiniMessage API. To find the values for [color](https://jd.advntr.dev/api/4.17.0/net/kyori/adventure/bossbar/BossBar.Color.html), [overlay](https://jd.advntr.dev/api/4.17.0/net/kyori/adventure/bossbar/BossBar.Overlay.html) or [flags](https://jd.advntr.dev/api/4.17.0/net/kyori/adventure/bossbar/BossBar.Flag.html) please refer to the MiniMessage documentation.

### TITLE

To send a title to the player, you must specify the title like this:

```yaml
example:
  type: TITLE
  title: "Title example"
  subtitle: "Subtitle example"
  start: 100 # 100ms, 0.1s
  time: 2800 # 2800ms, 2.8s
  end: 100 # 100ms, 0.1s
```

### Multi messages

You can send multiple messages at the same time, regardless of the type of message. Simply follow the documentation and apply the same example format to all message types. Here’s how to send multiple messages simultaneously:

```yaml
teleport-message-spawn:
  - message: "&7Teleporting in #0EEA93%seconds% &7seconds, you must not move."
  - type: ACTION
    message: "&7Teleporting in #0EEA93%seconds% &7seconds, you must not move."
  - type: TITLE
    title: "&fTeleportation !"
    subtitle: "&7Teleporting in #0EEA93%seconds% &7seconds, you must not move."
    start: 100 # 100ms, 0.1s
    time: 2800 # 2800ms, 2.8s
    end: 100 # 100ms, 0.1s
```

You must send a list with the type and corresponding configuration. The `TCHAT` type will always be the default; for other types, you are required to specify them explicitly.

***

## Files

### English

<https://github.com/Maxlego08/zEssentials/blob/master/Essentials/src/main/resources/messages/messages.yml>

### Français

<https://github.com/Maxlego08/zEssentials/blob/master/Essentials/src/main/resources/messages/messages_fr.yml>

### Italiano

[https://github.com/Maxlego08/zEssentials/blob/master/Essentials/src/main/resources/messages/messages\_it.yml](https://github.com/Maxlego08/zEssentials/blob/master/Essentials/src/main/resources/messages/messages_de.yml)

### German

<https://github.com/Maxlego08/zEssentials/blob/master/Essentials/src/main/resources/messages/messages_de.yml>


---

# 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://zessentials.groupez.dev/getting-started/messages.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.
