> For the complete documentation index, see [llms.txt](https://interactiveboard.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://interactiveboard.gitbook.io/docs/functions/general-information/conditions.md).

# Conditions

Conditions can be used to only have a function execute if conditions are met.

Information on various types of conditions can be found here: [Conditions](/docs/conditions/has-money.md)

{% tabs %}
{% tab title="Permission example" %}

```yaml
## Players with 'example.diamond' permission
## can get a diamond by clicking the button

diamond_button:
  type: button
  size: 256 128
  color: green
   
  on-click:
    give_function:
      type: command
      execute-from-console: true
      command: 'minecraft:give %player_name% diamond 1'
      conditions:
        perm1:
          type: permission
          permission: example.diamond
    no_perm:
      type: send_message
      message: 'You do not have the permission to get a diamond'
      conditions:
        noperm1:
          ## Negated check, it is met when player doesn't have the permission
          type: '!permission'
          permission: example.diamond      
          
```

{% endtab %}
{% endtabs %}
