> For the complete documentation index, see [llms.txt](https://gstudios.gitbook.io/gslibrary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gstudios.gitbook.io/gslibrary/actions-api/how-to-make-action.md).

# How to make action

This page will help you with using our actions api in configurations

### First steps, creating action

Okay, we're starting to create our first action. The new actions type that presents our actions library is based on sections. Here is an example of the functionality of sections in the config:

{% code title="example of section list" lineNumbers="true" %}

```yaml
actions: # <-- This is section name. 
  first: # <-- This is the first section in our list of sections. 
    data1: # <-- We can add multiple data rows to the section
    data2:
  second: # <-- This is another section. You can create unlimited sections in the list.
```

{% endcode %}

Now you know how to use actions. Lets take a look at action format.\
\
When we create an action, we name it arbitrarily. The name must be together and must be unique in the list.

{% code title="creating action,    action name" overflow="wrap" lineNumbers="true" %}

```yaml
actions:
  action_name: # <<<---
```

{% endcode %}

Now you have to add action data for full funcionality.<br>

Select a action from the [`list of library actions`](/gslibrary/actions-api/actions-list.md) or select action from [`specific plugin`](/gslibrary/our-plugins.md). For a example we will make a <mark style="color:blue;">message</mark> action with multiple lines.

Every action request type. Determine the type as follows:

{% code title="creating action,    action type" overflow="wrap" lineNumbers="true" %}

```yaml
actions:
  action_name:
    type: message # <-- here paste your selected action instead of a message
```

{% endcode %}

Now just add requested data for your action. Message only request values/value. Each action has a proper example in the [`action list`](/gslibrary/actions-api/actions-list.md).

{% code title="creating action,    action data" overflow="wrap" lineNumbers="true" %}

```yaml
actions:
  action_name:
    type: message
    values: # <-- example of message action
      - '&cHello %player_name%'
      - '&aThis action is so cool'
```

{% endcode %}

### Adding conditions

Now we have working action. But now we want to make a specific conditions for this action. It is really easy. Just make this:

{% code title="conditions example" overflow="wrap" lineNumbers="true" %}

```yaml
actions:
  action_name:
    conditions:
      #
      # condition data...
      #
    type: ...
```

{% endcode %}

If you don't know how to make a condition, you can go threw a tutorial [`here`](/gslibrary/conditions-api/how-to-make-condition.md)!
