# Usage

## Sending an action bar :speech\_balloon:

`action bar: message;` (example: `action bar: "&aHello, Steve!";`)

Sends an action bar message to the player.

<table><thead><tr><th align="center">Argument name</th><th width="205" align="center">Required</th><th align="center">Type</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">message</td><td align="center">yes</td><td align="center">string</td><td align="center">message to show (colors available)</td></tr></tbody></table>

{% hint style="info" %}
**Only available if ProtocolLib is installed.**
{% endhint %}

## Chatting :speech\_balloon:

`chat: message;` (example: `chat: I did not write this!;`)

Chats as the player, as if the player typed and sent the message.

| Argument name | Required |  Type  |   Description   |
| :-----------: | :------: | :----: | :-------------: |
|    message    |    yes   | string | message to chat |

## Running a console command :fast\_forward:

`console command: command;` (example: `console command: experience add @a 5 levels;`)

Runs command from the console.

| Argument name | Required |  Type  |              Description              |
| :-----------: | :------: | :----: | :-----------------------------------: |
|    command    |    yes   | string | command to run, without the leading / |

## Running a player command :fast\_forward:

`player command: command;` (example: `player command: lobby;`)

Runs command as the player.

| Argument name | Required |  Type  |              Description              |
| :-----------: | :------: | :----: | :-----------------------------------: |
|    command    |    yes   | string | command to run, without the leading / |

## Sending a message :speech\_balloon:

`message: message;` (example: `message: "&aHello, {name}!";`)

Sends the player a message.

| Argument name | Required |  Type  |                                        Description                                       |
| :-----------: | :------: | :----: | :--------------------------------------------------------------------------------------: |
|    message    |    yes   | string | message to send (colors available, `<br>` for a line break, `<center>` to center a line) |

## Sending a title :speech\_balloon:

`title: title, subtitle, fade-in, stay, fade-out;` (example: `title: Title, Subtitle, 0;`)

Sends the player a title.

| Argument name |      Required     |    Type    |             Description             |
| :-----------: | :---------------: | :--------: | :---------------------------------: |
|     title     |        yes        |   string   |   title to show (colors available)  |
|    subtitle   |        yes        |   string   | subtitle to show (colors available) |
|    fade-in    | no (default = 20) | integer 0+ |        fade-in time in ticks        |
|      stay     | no (default = 60) | integer 0+ |          stay time in ticks         |
|    fade-out   | no (default = 20) | integer 0+ |        fade-out time in ticks       |

{% hint style="info" %}
**On 1.8 available only if ProtocolLib is installed.**
{% endhint %}

## Playing a sound :loud\_sound:

`sound: name, volume, speed;` (example: `sound: ENTITY_PLAYER_LEVELUP;`)

Plays the player a sound.

| Argument name |     Required     |     Type     |                             Description                             |
| :-----------: | :--------------: | :----------: | :-----------------------------------------------------------------: |
|      name     |        yes       | sound (enum) | [sound name from the list](/chatgames/actions/enum-lists.md#sounds) |
|     volume    | no (default = 1) |   double 0+  |                                volume                               |
|     speed     | no (default = 1) | double 0.5-2 |        speed, 0.5 is 1/2 speed, 1 is normal and 2 is 2x speed       |

## Playing a note :notes:

`note: instrument, tone;` (example: `note: PIANO, random;`)

Plays the player a note.

| Argument name | Required |        Type       |                                             Description                                            |
| :-----------: | :------: | :---------------: | :------------------------------------------------------------------------------------------------: |
|   instrument  |    yes   | instrument (enum) |            [instrument name from the list](/chatgames/actions/enum-lists.md#instruments)           |
|      tone     |    yes   |    integer 0-24   | tone number, see [here](https://minecraft.fandom.com/wiki/Note_Block?file=Noteblock_reference.png) |

## Spawning a particle :zap:

`particle: name, count, offset-x, offset-y, offset-z;` (example: `particle: EXPLOSION_LARGE;`)

Spawns a particle at the player's location (visible only to the player).

| Argument name |     Required     |       Type      |                                Description                                |
| :-----------: | :--------------: | :-------------: | :-----------------------------------------------------------------------: |
|      name     |        yes       | particle (enum) | [particle name from the list](/chatgames/actions/enum-lists.md#particles) |
|     count     | no (default = 1) |   integer 1-32  |                        amount of particles to spawn                       |
|    offset-x   | no (default = 0) |    double 0+    |         random offset from player's X location, unavailable on 1.8        |
|    offset-y   | no (default = 0) |    double 0+    |         random offset from player's Y location, unavailable on 1.8        |
|    offset-z   | no (default = 0) |    double 0+    |         random offset from player's Z location, unavailable on 1.8        |

## Spawning a firework :fireworks:

`firework: power, effect-type, effect-color, effect-fade-color, effect-flicker, effect-trail;` (example: `firework: 3, STAR, random, random, yes, yes;`)

Spawns a firework at the player's location, visible to everyone online.

|   Argument name   |       Required       |             Type            |                                   Description                                  |
| :---------------: | :------------------: | :-------------------------: | :----------------------------------------------------------------------------: |
|       power       |          yes         |        integer 0-128        |                       power of the firework (flight time)                      |
|    effect-type    |  no (default = BALL) | firework effect type (enum) | [effect name from the list](/chatgames/actions/enum-lists.md#firework-effects) |
|    effect-color   | no (default = WHITE) |            color            |                               color of the effect                              |
| effect-fade-color | no (default = WHITE) |            color            |                            fade color of the effect                            |
|   effect-flicker  | no (default = false) |           boolean           |                          if the effect should flicker                          |
|    effect-trail   | no (default = false) |           boolean           |                   if the firework should leave a trail behind                  |


---

# 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://dejvokep.gitbook.io/chatgames/actions/usage.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.
