# Phases

Phases are used to broadcast different types of messages through different actions performed in games.

## Available types of actions

* `join` - when a player joins to game
* `leave` - when a player leaves a game
* `start` - when a game has started
* `stop` - when a game has stopped
* `kick` - when a player has kicked out of game
* `lobby_wait` - when players are waiting in lobby
* `player_won` - when a player won a game (classic)
* `you_won` - when you as a player won the game (classic)
* `zombies_incoming` - when a zombie wave is incoming in x time
* `next_wave` - when a next wave is about to start (apocalypse)
* `game_countdown` - sends on specific game countdown times
* `game_freeze` - when a game is in freeze state
* `kill` - when a player has killed another entity
* `death` - when a player dies in game
* `respawn` - when a player respawns in game
* `all_missions_completed` - when all mission has completed
* `skill_level_up` - when a player levels up in skill
* `drop_bonus_pickup` - when a player picks up a drop bonus
* `drop_crate_appear` - when a crate appears in game
* `drop_crate_interact` - when a player interacts with a dropped crate

## Message types with options

These are the types you can use with the below listed options as well

* [actionbar](https://minecraft.wiki/w/Action_bar)
  * `sound`, `broadcast-times`, `text`
* [bossbar](https://minecraft.wiki/w/Bossbar)
  * `sound`, `broadcast-times`, `text`
  * [color](https://jd.papermc.io/paper/org/bukkit/boss/BarColor.html)
  * [style](https://minecraft.wiki/w/Bossbar#Style)
  * `expire` - expire time in seconds defined
  * [flags](https://jd.papermc.io/paper/org/bukkit/boss/BarFlag.html)
* [message](https://minecraft.wiki/w/Chat)
  * `sound`, `broadcast-times`, `text`
* [broadcast](https://minecraft.wiki/w/Chat)
  * `sound`, `broadcast-times`, `text`
* [title](https://minecraft.wiki/w/Commands/title)
  * `sound`, `broadcast-times`, `subtitle`, `duration`
* [command](https://minecraft.wiki/w/Commands)
  * `broadcast-times`, `text`

### Option syntax and usage

`[]` - optional\
`<>` - required

* `sound`
  * `sound=<sound>,[soundCategory],[volume],[pitch]`
  * `sound=entity_enderman_teleport,master`
    * [sounds list](https://jd.papermc.io/paper/org/bukkit/Sound.html)
    * [sound category](https://jd.papermc.io/paper/org/bukkit/SoundCategory.html)
* `broadcast-times`
  * Allowed formats:
    * `broadcast-times=10,5s,3s,1m`
    * `broadcast-times=3m`
    * `broadcast-times=10`
    * `broadcast-times=30,10,5,4,3,2,1`
* `duration` (for title, optional)
  * `duration=fade-in,stay,fade-out`
  * `duration=20,5,20`

## Configuration

```yml
phases:
  join:
  - type=actionbar; text=<red>Hello<green> %player%<red> in this game!
  - type=broadcast; text=<dark_green>%player%<blue> joined to the game
  start:
  - type=actionbar; text=<green>Game has started!<dark_green> We wish you a good game!
  - type=bossbar; color=green; style=segmented_6; expire=8; text=<aqua>Welcome<green> %player%<aqua> in<red> %game%<aqua> game!
  lobby_wait:
  - type=title; broadcast-times=5,4,3,2,1; duration=20,5,20; title=; subtitle=
  - type=message; broadcast-times=30,20,10s,5,4,3,2,1; text=<blue>This round will start in<yellow> %time%<blue> seconds.
```

* `phases` - The list of phases, you can create and add multiple elements to action list
  * `actionName`, syntax:
    * ```yml
      - type=name; option=value; option=value
      ```


---

# 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://mdswork.gitbook.io/ragemode-docs/global-game-guides/phases.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.
