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

# erlc.dev Studio Block Catalog: All Available Block Types

> A complete overview of every block category in erlc.dev Studio — event triggers, action blocks, value blocks, and how they connect together.

Every automation in erlc.dev Studio is built by connecting blocks together on the canvas. Blocks come in three fundamental shapes: **event triggers** that start a run, **action blocks** that do work in sequence, and **value blocks** that produce data you feed into other blocks. Understanding these shapes — and which categories exist within each type — is the foundation for building reliable automations.

## How block shapes work

Before diving into categories, it helps to understand how the connector system works.

<CardGroup cols={3}>
  <Card title="Event Trigger shape" icon="bolt">
    No connector on top (nothing runs before them). One connector on the bottom — action blocks snap beneath them. These always start a run.
  </Card>

  <Card title="Action block shape" icon="arrow-down">
    A connector notch on top and a connector tab on the bottom. They slot into a vertical chain, reading top-to-bottom.
  </Card>

  <Card title="Value block shape" icon="circle-dot">
    An output peg on one side, no top/bottom connectors. They plug into input sockets on action or other value blocks to supply data.
  </Card>
</CardGroup>

***

## Event Triggers

Event trigger blocks have **no previous connector** (nothing runs before them) and **one next connector** (action blocks attach below). Every automation must start with exactly one event trigger block. Studio fires the automation whenever the corresponding event occurs.

<AccordionGroup>
  <Accordion title="ERLC Game Events">
    | Block | Description |
    | - | - |
    | `erlc_when_event` | Fires when a specific ERLC game event occurs. Use the dropdown to choose from events such as `player_joined`, `player_killed`, `command_run`, and others exposed by the ERLC API. |
    | `erlc_when_game_command` | Fires when a player runs a custom in-game command you define. Configure the command name in the block's field. |
    | `erlc_when_server_active` | Fires when your ERLC private server transitions to an active state (players present and server running). |
  </Accordion>

  <Accordion title="Discord Interaction Events">
    | Block | Description |
    | - | - |
    | `erlc_when_slash_command` | Fires when a user invokes a Discord slash command. Configure the command name and any options in the block's fields. |
    | `erlc_when_discord_button` | Fires when a user clicks a button component on a Discord message. Match interactions by the button's custom ID. |
    | `erlc_when_discord_modal` | Fires when a user submits a modal form in Discord. Receives all field values from the submitted form. |
    | `erlc_when_discord_select` | Fires when a user picks one or more options from a Discord select menu component. |
    | `erlc_when_discord_event` | Fires on raw Discord gateway events such as `message_create`, `member_join`, `reaction_add`, and others. Use the event name field to specify which event to listen for. |
    | `erlc_when_bot_online` | Fires once when your Discord bot successfully connects and becomes online. Useful for initialization logic. |
  </Accordion>

  <Accordion title="Automation & System Events">
    | Block | Description |
    | - | - |
    | `erlc_when_broadcast` | Fires when another automation (or a page) sends a named broadcast signal using `erlc_broadcast` or `erlc_broadcast_value`. |
    | `erlc_when_ai_responds` | Fires when an AI action finishes generating a response. Use the output value blocks to read the result. |
    | `erlc_when_manual` | A manually-triggered entry point. You invoke this from outside the normal event pipeline — useful for one-off or maintenance automations. |
    | `erlc_when_test_run` | Fires when you click the **Test Run** button in the Studio toolbar. Use this for development and debugging. |
  </Accordion>
</AccordionGroup>

<Note>
  Each automation canvas should have only one event trigger block as its root. If you need to respond to multiple events with the same logic, create a shared [page](/studio/pages-and-flow) and call it from separate automations.
</Note>

***

## Action Blocks

Action blocks sit in the vertical chain beneath an event trigger. They execute in order from top to bottom. Each has a **previous connector** on top and a **next connector** on the bottom.

<AccordionGroup>
  <Accordion title="Discord Bot Actions">
    | Block | Description |
    | - | - |
    | Send message | Sends a text or embed message to a specified Discord channel. |
    | Reply to interaction | Sends an ephemeral or public reply to a slash command, button, select, or modal interaction. |
    | Add role | Grants a Discord role to a specified member. |
    | Remove role | Removes a Discord role from a specified member. |
    | Ban member | Bans a member from the Discord server, with an optional reason. |
    | Kick member | Kicks a member from the Discord server. |
    | Create channel | Creates a new text, voice, or category channel. |
    | Delete channel | Deletes an existing channel by ID. |
    | Send DM | Sends a direct message to a specified user. |
    | Open modal | Sends a modal dialog to the user who triggered the interaction. |
    | Edit message | Edits a previously sent message by channel ID and message ID. |
    | Delete message | Deletes a message from a channel. |
  </Accordion>

  <Accordion title="Game (ERLC) Actions">
    | Block | Description |
    | - | - |
    | `erlc_command` | Runs a predefined in-game server command. Configure the command name and arguments in the block's fields. |
    | `erlc_dynamic_command` | Runs an in-game server command whose name or arguments are determined at runtime from value block inputs. |
  </Accordion>

  <Accordion title="Flow Control">
    | Block | Description |
    | - | - |
    | `erlc_if_then` | Executes its inner block stack only when the condition value is true. |
    | `erlc_if_else` | Executes the first inner stack when the condition is true, or the second inner stack when it is false. |
    | `erlc_while` | Repeats its inner stack while the condition remains true. |
    | `erlc_repeat` | Repeats its inner stack a fixed number of times. |
    | `erlc_repeat_for_seconds` | Repeats its inner stack continuously for a specified number of seconds. |
    | `erlc_repeat_until` | Repeats its inner stack until a condition becomes true. |
    | `erlc_for_each` | Iterates over each item in a list, exposing the current item as a variable. |
    | `erlc_forever` | Repeats its inner stack indefinitely. Has no next connector — nothing runs after it in the same stack. |
    | `erlc_break_loop` | Exits the nearest enclosing loop immediately. |
    | `erlc_continue_loop` | Skips the rest of the current loop iteration and starts the next one. |
    | `erlc_wait` | Pauses execution for a specified number of seconds before continuing. |
    | `erlc_wait_until` | Pauses execution until a condition evaluates to true. |
    | `erlc_stop_run` | Stops the entire automation run immediately. No further blocks execute. |
    | `erlc_stop_stack` | Stops the current block stack only. Parent stacks continue if applicable. |
    | `erlc_throttle` | Limits how often an inner block of code can execute within a given time window. |
    | `erlc_run_once` | Runs its inner stack only once per unique key. Subsequent calls with the same key are skipped. |
    | `erlc_try_catch` | Executes its main stack; if an error occurs, execution jumps to the catch stack instead. |
  </Accordion>

  <Accordion title="Data & Variables">
    | Block | Description |
    | - | - |
    | `erlc_set_variable` | Creates or overwrites a local variable by name with a given value. The variable lives for the duration of the current run. |
    | `erlc_change_variable` | Adds a numeric amount to an existing local variable's value. |
    | `erlc_data_variable_set` | Writes a value to a persistent server-side variable that survives across runs. |
    | `erlc_data_variable_delete` | Deletes a persistent variable by name. |
    | `erlc_list_add` | Appends an item to a local list variable. |
    | `erlc_list_remove` | Removes an item from a local list variable by value or index. |
    | `erlc_broadcast` | Fires a named broadcast signal to any `erlc_when_broadcast` automation listening for that name. |
    | `erlc_broadcast_value` | Fires a named broadcast signal and attaches a data payload that the receiving automation can read. |
    | `erlc_call_page` | Calls a reusable page (sub-routine) by name and waits for it to complete before continuing. |
  </Accordion>

  <Accordion title="Debug">
    | Block | Description |
    | - | - |
    | `erlc_log` | Writes a message to the Studio log panel. Accepts any value block as input. Essential for debugging. |
    | `erlc_debug_assert` | Checks that a condition is true. If it is false, logs an assertion failure and stops the run. |
  </Accordion>
</AccordionGroup>

***

## Value Blocks

Value blocks produce data — text, numbers, booleans, lists, or objects — that you plug into the input sockets of action or other value blocks. They have **no top or bottom connector**; they only have an output peg.

<AccordionGroup>
  <Accordion title="Event Data Values">
    | Block | Description |
    | - | - |
    | `erlc_event_value` | Reads a named property from the current ERLC game event payload (e.g. `player_name`, `player_id`). |
    | `erlc_discord_event_value` | Reads a named property from the current Discord event payload (e.g. `user_id`, `channel_id`, `message_content`). |
    | `erlc_received_message_name` | Returns the name of the broadcast signal received by `erlc_when_broadcast`. |
    | `erlc_received_message_value` | Returns the data payload attached to the broadcast received by `erlc_when_broadcast`. |
  </Accordion>

  <Accordion title="Variable & Data Values">
    | Block | Description |
    | - | - |
    | `erlc_variable_value` | Reads the current value of a named local variable set earlier in the run. |
    | `erlc_data_variable_get` | Reads the current value of a named persistent variable from server-side storage. |
    | `erlc_list_contains` | Returns `true` if a list contains a specified item, `false` otherwise. |
    | `erlc_list_length` | Returns the number of items in a list. |
  </Accordion>

  <Accordion title="Player & Server Data">
    | Block | Description |
    | - | - |
    | Player data blocks | Return information about players currently in the ERLC server — username, team, vehicle, and other fields provided by the ERLC API. |
    | Server data blocks | Return server-level information such as join code, player count, and server status. |
  </Accordion>

  <Accordion title="Text, Math & Logic">
    | Block | Description |
    | - | - |
    | Text literal | A plain text string you type directly into the block. |
    | Text join | Concatenates two or more text values. |
    | Text contains / replace / split | Standard string manipulation operations. |
    | Number literal | A numeric value you type into the block. |
    | Arithmetic | Add, subtract, multiply, divide two number values. |
    | Comparison | Returns `true` or `false` by comparing two values (`=`, `≠`, `<`, `>`, `≤`, `≥`). |
    | Logic AND / OR / NOT | Combines boolean values using logical operators. |
    | Boolean literal | A hard-coded `true` or `false` value. |
  </Accordion>

  <Accordion title="Lists">
    | Block | Description |
    | - | - |
    | Create list | Creates a new empty list or a list pre-populated with items. |
    | List get item | Returns the item at a specified index in a list. |
    | `erlc_list_length` | Returns the number of items in a list (also usable as a value anywhere a number is expected). |
    | `erlc_list_contains` | Returns a boolean indicating whether a list contains a given item. |
  </Accordion>
</AccordionGroup>

<Tip>
  Value blocks can be nested. For example, you can plug a **Text join** block into the input of an `erlc_log` block, and inside the Text join, plug an `erlc_variable_value` block — all in one expression.
</Tip>


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