> For the complete documentation index, see [llms.txt](https://ajneb97.gitbook.io/conditionalevents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajneb97.gitbook.io/conditionalevents/event-types/block-events.md).

# Block Events

## BLOCK INTERACT

Event called when a player clicks on a block.

```yaml
example:
  type: block_interact
  conditions:
  - '%block_x% == 20'
  - '%block_y% == 60'
  - '%block_z% == 20'
  - '%block_world% == lobby'
  - '%block% == STONE_BUTTON'
  - '%action_type% == RIGHT_CLICK'
  actions:
    default:
    - "message: &aYou''ve received $500!"
    - "console_command: eco give %player% 500"
```

{% hint style="success" %}
**Variables:**

* <mark style="color:green;">%action\_type%</mark> (RIGHT\_CLICK, LEFT\_CLICK, SHIFT\_RIGHT\_CLICK, SHIFT\_LEFT\_CLICK

  &#x20;or PHYSICAL. Use PHYSICAL when you want to check players on pressure plates)
* <mark style="color:green;">%face%</mark> (Clicked face. All values here: <https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/BlockFace.html>)
* ConditionalEvents <mark style="color:green;">block variables</mark>
* ConditionalEvents <mark style="color:green;">item variables</mark> (for item in hand)
  {% endhint %}

## BLOCK BREAK

Event called when a player breaks a block.

```yaml
example:
  type: block_break
  conditions:
  - '%block_head_texture% != %empty%'
  actions:
    default:
    - 'cancel_event: true'
    - "message: &cYou can''t break heads with texture!"
    - 'playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1'
```

{% hint style="success" %}
**Variables:**

* ConditionalEvents <mark style="color:green;">block variables</mark>
* ConditionalEvents <mark style="color:green;">item variables</mark> (for item in hand)
  {% endhint %}

## BLOCK PLACE

Event called when a player places a block.

```yaml
example:
  type: block_place
  conditions:
  - '%block_world% == spawn'
  actions:
    default:
    - 'cancel_event: true'
    - "message: &cYou can''t place blocks on this world."
    - 'playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1'
```

{% hint style="success" %}
**Variables:**

* ConditionalEvents <mark style="color:green;">block variables</mark>
* ConditionalEvents <mark style="color:green;">item variables</mark> (for item in hand)
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ajneb97.gitbook.io/conditionalevents/event-types/block-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
