> For the complete documentation index, see [llms.txt](https://docs.discorddungeons.me/quest-editor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discorddungeons.me/quest-editor/logic-blocks/if.md).

# If Block

![If Block](/files/-LNihMjiFdrtsTYe55xg)

The if block executes a block of code if a specified condition is true.

To specify a condition, add a block to the `if` input.

To specify what should be executed if the condition is true, add blocks to the `do` input.

## Generated Code

```javascript
if (condition) {
    // Do
}
```
