> 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](https://602309350-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LNeYKoJ5VTmJdlF1rx1%2F-LNihKFQ2MXuem_lR31S%2F-LNihMjiFdrtsTYe55xg%2Fif.jpg?generation=1538381978496886\&alt=media)

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
}
```
