> For the complete documentation index, see [llms.txt](https://simple.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simple.superiormc.cn/mythicrewards/format/action-format.md).

# 🎬Action Format

The action format will consist of several options.

{% hint style="info" %}
The `general-actions` in the **Action Format** **example** only represent **Action Format** start from here. Please refer to the page description of the corresponding function for specific option names, such as `pack-actions` or `general-actions`.
{% endhint %}

## General Options

### Rank Limits

Actions will only be executed or conditions will be considered if the player's ranking falls within the limit range. Supported format:

* A number: like `5`. The representative will only be in the **N**th place.
* Use two numbers separated by `~` symbol: like `1~5`. All rankings within this range will be considered.
* `>=` symbol before a number: like `>=1`.
* `<=` symbol before a number: like `<=10`.

```yaml
general-actions:
  1:
    type: message
    rank-limit: 1~2
    message: TEST2
```

### Math <a href="#math" id="math"></a>

You can use placeholders and [Math Calculate Format](https://ultimateshop.superiormc.cn/format/math-calculate-format) in number-type option's value! Just set `math.enabled` option to `true` in `config.yml` file and then enjoy!

```yaml
general-actions:
  1:
    type: chance
    rate: '{percentage}/3' # Use math here.
    actions:
      1:
        type: message
        message: TEST
```

## Supported Placeholders

MythicRewards supports those placeholders in ActionFormat and ConditionFormat.

* {world}
* {player-x}
* {player-y}
* {player-z}
* {player-pitch}
* {player-yaw}
* {player} - Player Name
* {entity-x}
* {entity-y}
* {entity-z}
* {entity-pitch}
* {entity-yaw}
* {entity} - Entity Name
* {entity-health} - Added in 1.0.5.
* {total-damage}
* {rank}
* {damage}&#x20;
* {percentage}
* {player\_\<rank>}, like `{player_1}`. representing the top ranked player.
* {damage\_\<rank>}, like `{damage_1}`.
* {percentage\_\<rank>}, like `{percentage_1}`.

## Sound

Send sound to player.

```yaml
general-actions:
  1:
    type: sound
    sound: 'ui.button.click'
    volume: 1
    pitch: 1
```

## Message

Send a message to the player, support color code.

```yaml
general-actions:
  1:
    type: message
    message: 'Hello!'
```

## Messages

Support multi line.

The line starting with **@ plus a number plus a space** represents that it will only be displayed when there are so many reward players, for example, `@5` (Don't miss the space) represents that it must have 5 reward players to display this line. If there aren't as many players who need rewards, we don't need to display data that ranks lower, so this feature is very important for users who want to hide useless data. In this example, if there is no second place, we will not display the information of the second place, and so on.

```yaml
general-actions:
  1:
    type: message
    messages:
      - '&#FFEE00======================='
      - '&#FF5555⚔ &l{entity-name} &r&#FF4444has been defeated11! ⚔'
      - '&#00FFAA✨TOP DAMAGE DEALERS✨'
      - '@1 &#FF4500🥇 &lFirst: &#FF69B4{player_1} &#FFFFFF(&#32CD32{damage_1}&#FFFFFF | &#1E90FF{percentage_1}%&#FFFFFF)'
      - '@2 &#1E90FF🥈 &lSecond: &#00FFFF{player_2} &#FFFFFF(&#32CD32{damage_2}&#FFFFFF | &#FF69B4{percentage_2}%&#FFFFFF)'
      - '@3 &#32CD32🥉 &lThird: &#FFD700{player_3} &#FFFFFF(&#32CD32{damage_3}&#FFFFFF | &#FF4500{percentage_3}%&#FFFFFF)'
      - '&#FFAA00✨Your Rank: &#FF00FF {rank} &#FFFFFF(&#32CD32{damage}/{total-damage}&#FFFFFF | &#1E90FF{percentage}%&#FFFFFF)'
      - '&#FFEE00======================='
```

## Title <a href="#title" id="title"></a>

Send title to the player, support the color code.

```yaml
general-actions:
  1:
    type: title
    main-title: 'Good day'
    sub-title: 'Not bad'
    fade-in: 10
    stay: 70
    fade-out: 30
```

## Particle <a href="#particle" id="particle"></a>

```yaml
actions:
  1: 
    type: particle
    particle: HEART
    count: 20
    offset-x: 0.3
    offset-y: 1.0
    offset-z: 0.3
    speed: 0.01
```

## Effect

Give players potion effect.

```yaml
general-actions:
  1:
    type: effect
    potion: BLINDNESS
    duration: 60
    level: 1
    ambient: true # Optional
    particles: true # Optional
    icon: true # Optional
```

## Teleport

Teleport player to specified location.

```yaml
general-actions:
  1:
    type: teleport
    world: LobbyWorld
    x: 100
    y: 30
    z: 300
    pitch: 90 # Optional
    yaw: 0 # Optional
```

## Player Command

Make the player excutes a command.

```yaml
general-actions:
  1:
    type: player_command
    command: 'tell Hello!'
```

## Op Command

Make the player excutes a command as OP.

```yaml
general-actions:
  1:
    type: op_command
    command: 'tell Hello!'
```

## Console Command

Make the console excutes a command.

```yaml
general-actions:
  1:
    type: console_command
    command: 'op {player}'
```

## Spawn vanilla mobs

Spawn vanilla mobs.

```yaml
general-actions:
  1:
    type: entity_spawn
    entity: ZOMBIE
    world: LOBBY # Optional
    x: 100.0 # Optional
    y: 2.0 # Optional
    z: -100.0 # Optional
```

## MythicMobs spawn

Require MythicMobs.

```yaml
general-actions:
  1:
    type: mythicmobs_spawn
    entity: Super_Skeleton
    level: 1 # Optional
    world: LOBBY # Optional
    x: 100.0 # Optional
    y: 2.0 # Optional
    z: -100.0 # Optional
```

## Delay

Make the action run after X ticks.

```yaml
general-actions:
  1:
    type: delay
    time: 50
    actions:
      1:
        type: entity_spawn
        entity: ZOMBIE
```

## Chance

Set the chance the action will be excuted, up to 100. 50 means this action has 50% chance to excute.

```yaml
genneal-actions:
  1:
    type: chance
    rate: 50
    actions:
      1:
        type: entity_spawn
        entity: ZOMBIE
```

## Any

Randomly choose specified amount of actions to execute.

```yaml
general-actions:
  1:
    type: any
    amount: 2
    actions:
      1:
        type: entity_spawn
        entity: ZOMBIE
      2:
        type: entity_spawn
        entity: SKELETON
      3:
        type: entity_spawn
        entity: WITHER
```

## Conditional

Only players meet the conditions you set here will be able to execute the action.

```yaml
general-actions:
  1:
    type: conditional
    conditions:
      1: 
        type: world
        world: lobby
    actions:
      1:
        type: entity_spawn
        entity: ZOMBIE
```

## Give Item <mark style="color:red;">- Premium</mark>

Should use ItemFormat in `item` option. For more info about Item Format, plaese [click here](https://ultimateshop.superiormc.cn/format/itemformat-tm).

```yaml
general-actions:
  1:
    type: give_item
    item:
      material: apple # Item Format here
```

## Drop Item <mark style="color:red;">- Premium, Paper 1.19.1+ only</mark>

Should use ItemFormat in `item` option. For more info about Item Format, plaese [click here](https://ultimateshop.superiormc.cn/format/itemformat-tm).

```yaml
general-actions:
  1:
    type: drop_item
    item:
      material: apple # Item Format here
      world: world # Optional, support placeholder
      x: 15 # Optional, support placeholder
      y: 12 # Optional, support placeholder
      z: 10 # Optional, support placeholder
```


---

# 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://simple.superiormc.cn/mythicrewards/format/action-format.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.
