> For the complete documentation index, see [llms.txt](https://pretti.gitbook.io/prtminetreasures/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pretti.gitbook.io/prtminetreasures/treasures/rewards/commands.md).

# Commands

#### List of reward commands:

{% code lineNumbers="true" %}

```yaml
commands:       
# Run command by Console
- "[CONSOLE] give %player_name% stone 1"

# Run command by Player
- "[PLAYER] &9I'm a nice guy, everyone."

# Messages
- "[MESSAGE] &6[Treasure] &7- &7You have found another &aEffect Command&7 treasure!"
- "[RANGE_MESSAGE] 50 &7Someone received a treasure near you!"
- "[BROADCAST] &8A global event has started!"

# Sounds
- "[SOUND] ENTITY_PLAYER_LEVELUP 1.0 1.0"
- "[WORLD_SOUND] ENTITY_PLAYER_LEVELUP 2.0 0.8"
- "[EVENT_SOUND] ENTITY_PLAYER_LEVELUP 1.0 1.5"
- "[WORLD_EVENT_SOUND] ENTITY_PLAYER_LEVELUP 1.5 1.0"

# Title
- "[TITLE] 10 60 20 T:&9Treasure Found! S:&bYou found a command!"
- "[BROADCAST_TITLE] 10 60 20 T:&9Treasure Found! S:&bYou found a command!"

# ActionsBar
- "[ACTIONBAR] &eYou have found another magical treasure!"
- "[BROADCAST_ACTIONBAR] &a%player_name%&b is a nice guy!"

# Effects
- "[EFFECT] CLEAR"
- "[EFFECT] SET speed 60 2"
- "[EFFECT] REMOVE speed"
- "[EFFECT] ADD speed 60 2"

```

{% endcode %}

***

## \[CONSOLE]

Executes a command as console.

* `[CONSOLE] command`
  * **command**: The command to be executed.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[CONSOLE] give %player_name% stone 1"
```

{% endcode %}

***

## \[PLAYER]

Executes a command as a player.

* `[PLAYER] command`
  * **command**: The command to be executed by the player.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[PLAYER] &9I'm a nice guy, everyone."
```

{% endcode %}

***

## \[MESSAGE]

Sends a message to the player.

* `[MESSAGE] text`
  * **text**: The message to be sent.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[MESSAGE] &9You found a treasure!"
```

{% endcode %}

***

## \[RANGE\_MESSAGE]

Sends a message to all players within a specific distance (in blocks).

* `[RANGE_MESSAGE] distance text`
  * **distance**: Distance in blocks.
  * **text**: The message to be sent.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[RANGE_MESSAGE] 50 &7Someone received a treasure near you!"
```

{% endcode %}

***

## \[BROADCAST]

Sends a message to all players.

* `[BROADCAST] text`
  * **text**: The message to be sent.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[BROADCAST] &8A global event has started!"
```

{% endcode %}

***

## \[SOUND]

Sends a sound to the player.

* `[SOUND] sound volume pitch`
  * **sound**: Sound name.
  * **volume**: Sound volume.
  * **pitch**: Sound pitch.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[SOUND] ENTITY_PLAYER_LEVELUP 1.0 1.0"
```

{% endcode %}

***

## \[WORLD\_SOUND]

Sends a sound to all players in the world.

* `[WORLD_SOUND] sound volume pitch`
  * **sound**: Sound name.
  * **volume**: Sound volume.
  * **pitch**: Sound pitch.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[WORLD_SOUND] ENTITY_PLAYER_LEVELUP 2.0 0.8"
```

{% endcode %}

***

## \[EVENT\_SOUND]

Sends a sound at the event location to the player.

* `[EVENT_SOUND] sound volume pitch`
  * **sound**: Sound name.
  * **volume**: Sound volume.
  * **pitch**: Sound pitch.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[EVENT_SOUND] ENTITY_PLAYER_LEVELUP 1.0 1.5"
```

{% endcode %}

***

## \[WORLD\_EVENT\_SOUND]

Sends a sound at the event location to all players.

* `[WORLD_EVENT_SOUND] sound volume pitch`
  * **sound**: Sound name.
  * **volume**: Sound volume.
  * **pitch**: Sound pitch.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[WORLD_EVENT_SOUND] ENTITY_PLAYER_LEVELUP 1.5 1.0"
```

{% endcode %}

***

## \[TITLE]

Sends a title to the player.

* `[TITLE] fadeInTicks stayTicks fadeOutTicks T:title S:subtitle`
  * **fadeInTicks**: Duration of fade-in in ticks.
  * **fadeOutTicks**: Duration of fade-out in ticks.
  * **T:title**: Main text.
  * **S:subtitle**: Subtitle text.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[TITLE] 10 60 20 T:&9Treasure Found! S:&bYou found a command!"
```

{% endcode %}

***

## \[BROADCAST\_TITLE]

Sends a title to all players.

* `[BROADCAST_TITLE] fadeInTicks stayTicks fadeOutTicks T:title S:subtitle`
  * **fadeInTicks**: Duration of fade-in in ticks.
  * **fadeOutTicks**: Duration of fade-out in ticks.
  * **T:title**: Main text.
  * **S:subtitle**: Subtitle text.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[BROADCAST_TITLE] 10 60 20 T:&9Treasure Found! S:&bYou found a command!"
```

{% endcode %}

***

## **\[ACTIONBAR]**

Executes a command as console.

* `[ACTIONBAR] message`
  * **message**: The command to be executed.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[ACTIONBAR] Be careful %player_name%! An enemy is nearby."
```

{% endcode %}

***

## **\[BROADCAST\_ACTIONBAR]**

Executes a command as console.

* `[BROADCAST_ACTIONBAR] message`
  * **message**: The command to be executed.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[BROADCAST_ACTIONBAR] &a%player_name%&b is a nice guy!"
```

{% endcode %}

***

## **\[EFFECT]**

Adds, removes, or clears potion effects.

* **CLEAR**
  * Clears the player's potion effects.
  * `[EFFECT] CLEAR`
* **ADD**
  * Adds a new potion effect to the player.
  * `[EFFECT] ADD type duration level`
    * **type**: Effect type.
    * **duration**: Effect duration in ticks.
    * **level**: Effect level.
* **SET**
  * Clears and sets a new potion effect for the player.
  * `[EFFECT] SET type duration level`
    * **type**: Effect type.
    * **duration**: Effect duration in ticks.
    * **level**: Effect level.
* **REMOVE**
  * Removes a specific potion effect from the player.
  * `[EFFECT] REMOVE type`
    * **type**: Effect type.

**Example**:

{% code lineNumbers="true" %}

```yaml
- "[EFFECT] CLEAR"
- "[EFFECT] ADD speed 60 2"
- "[EFFECT] SET speed 60 2"
- "[EFFECT] REMOVE speed"
```

{% endcode %}
