> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Dialog Conditions

> Gate nodes and choices: time, weather, items, permissions, and combining with variables.

Conditions gate a [dialog](https://entities.lodemc.net/dialogs.md) node or a single choice: a reply that only appears if you're carrying the right item, a greeting that only happens at night. They are the same [conditions](https://entities.lodemc.net/conditions.md) that gate skills and `if` lines, so anything listed there works here too.

```yaml theme={null}
  choices:
  - text: "Want this diamond?"
    conditions:
    - hasitem{item=diamond}
    goto: trade
```

## Common ones

The full list is on [Conditions](https://entities.lodemc.net/conditions.md). These are the ones conversations use most:

| Condition | True when |
| - | - |
| `isday` | it's daytime in the world |
| `isnight` | it's nighttime |
| `raining` | it's raining |
| `thundering` | there's a thunderstorm |
| `sneaking` | the subject is sneaking |
| `hasitem{item=diamond;amount=3}` | the subject's inventory holds that item (and amount) |
| `holding{item=diamond_sword}` | the subject is holding that item |
| `hasPermission{perm=some.node}` | the subject has that permission |
| `variableEquals{var=target.quest;value=done}` | a variable has that value |
| `gamemode{m=creative}` | the subject is in that game mode |

## Who the subject is

* **In a dialog:** the player having the conversation.
* **In an effect line** (`if` / `while`): the line's first target.

## Combining conditions

They use the same [condition language](https://entities.lodemc.net/conditions.md#combining-them) as everything else, so they combine with `&&` and `||` and mix with variables and comparisons:

```yaml theme={null}
conditions:
- isnight && var.quest_stage >= 2
```

Multiple entries in a `conditions:` list must all pass.

## Quest state

Pair conditions with [variables](https://entities.lodemc.net/variables.md) for conversations that remember. Set a variable in a node's `effects`, check it in a later node's `conditions`, and your NPC knows where the player is in a questline:

```yaml theme={null}
  start: [quest_done, quest_active, first_meeting]
  quest_done:
    conditions: [target.var.quest_stage >= 2]
    say: "&fThanks again, friend."
  quest_active:
    conditions: [target.var.quest_stage >= 1]
    say: "&fGot those emeralds yet?"
  first_meeting:
    say: "&fYou must be new around here."
```

The `start:` list is checked top to bottom, so put the most specific state first.

> Remember the [YAML brace rule](https://entities.lodemc.net/dialog-files.md): conditions with `{...}` need a block list, not an inline one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.