> For the complete documentation index, see [llms.txt](https://paw-studio.gitbook.io/paw-studio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paw-studio.gitbook.io/paw-studio-docs/litedungeon/dungeon-configuration/rules.md).

# ⚡Rules

**Rules** allow you to create custom dungeon logic by combining **Triggers** and **Actions**.

A Rule defines **when something should happen** and **what should happen when the condition is met**.

### Rule Settings

#### Visibility

Controls how Trigger and Action blocks are displayed with Glow.

* **`ALL`** — Displays all blocks.
* **`FIRST`** — Displays only the first block, making the visualization more compact.
* **`HIDE`** — Completely hides all Glow blocks.

#### ID

Every Rule must have a **unique ID**.

The ID is used to identify the Rule and distinguish it from other Rules in the dungeon.

***

### Triggers

A Rule can contain an **unlimited number of Triggers**.

As soon as **at least one Trigger** is activated, the entire Action chain of the Rule is executed.

For example:

```
Trigger A ─┐
Trigger B ─┼──→ Actions
Trigger C ─┘
```

If any of the three triggers activates, the Actions will run.

***

### Actions

Actions define what happens when a Trigger is activated.

Each Action has a **Maximum Uses** setting.

#### Maximum Uses

Defines how many times an Action can be executed after its Trigger is activated.

For example:

```
Maximum Uses: 1
```

The Action will execute only **once**, even if its Trigger continues to activate.

Example:

```
Trigger: Detect Player
Action: Spawn 2 Creepers
Maximum Uses: 1
```

The `Detect Player` trigger may activate repeatedly while the player remains in the detection area, but the Action will spawn the Creepers **only once**.

This allows you to create one-time events while keeping triggers active.
