# Mechanics

This guide explains all the mechanics and click actions available in EasyBrushes.

### Click Actions

Click actions define how a brush responds to different types of clicks. Each brush can have different actions for different click types.

#### Available Click Types

| Click Type          | Description         | Example Usage          |
| ------------------- | ------------------- | ---------------------- |
| `left_click`        | Normal left click   | Single block placement |
| `right_click`       | Normal right click  | Rectangular selection  |
| `shift_left_click`  | Shift + left click  | Elliptical selection   |
| `shift_right_click` | Shift + right click | Execute commands       |

Use these to define what the [Action ](/eb/features/mechanics/action-types.md)is.

### Command System

#### Command Types

**Console Commands**

* Format: `[console] command here`
* Runs with console permissions
* Supports placeholders
* Can affect any player
* Full permission access

```yaml
mechanics:
  commands:
    - '[console] give %player% diamond'
    - '[console] effect give %player% speed 30 2'
```

**Message Commands**

* Format: `[message] message here <delay=ticks>`
* Sends messages to player
* Supports color codes
* Optional delay in ticks
* Perfect for feedback

```yaml
mechanics:
  commands:
    - '[message] &aBlock placed! <delay=20>'
    - '[message] &eReady for next action!'
```

#### Selection Properties

**Size Limits**

```yaml
brush:
  max_blocks_per_action: 1000  # Maximum blocks per selection
```

**Preview System**

```yaml
brush:
  glow:
    size: "SHOWN"  # Preview size
    update_rate: 1  # Update frequency
```

### Block Placement Rules

#### Placement Sides

Controls which faces blocks can be plainted on:

```yaml
placeable_sides: ALL  # ALL, WALL, FLOOR, CEILING
```

* **ALL**: Any face
* **WALL**: Only vertical faces (N,S,E,W)
* **FLOOR**: Only upward faces
* **CEILING**: Only downward faces

#### Placement Targets

Define which blocks can be painted on:

```yaml
placeable_on: ALL  # ALL or SPECIFIC
placeable_blocks:
  stone:
    material: STONE
    permission: all
```

#### Placeable Blocks

Define which blocks can be used as "paint":

```yaml
available_blocks:
  stone:
    material: STONE
    permission: all
```

### Complete Example

Here's a complete example showing all mechanics:

```yaml
brushes:
  advanced_brush:
    itemname: '&6&lAdvanced Brush'
    material: BLAZE_ROD
    mechanics:
      click_actions:
        left_click: SINGLE
        right_click: RECTANGULAR
        shift_left_click: ELLIPSE
        shift_right_click: CONSOLE
      commands:
        - '[console] effect give %player% speed 10 2'
        - '[message] &aActivated! <delay=20>'
        - '[message] &eSpeed boost applied! <delay=40>'
    placeable_on: ALL
    placeable_sides: ALL
    glow: true
    durability_use: 1
    particle: true
```

### Technical Details

#### Performance Impact

* Selection size affects performance
* Preview updates use resources
* Command execution has delay
* Particle effects cost CPU
* Display entities use memory

#### Best Practices

1. Limit selection sizes
2. Use appropriate modes
3. Optimize command usage
4. Balance visual effects
5. Consider server load


---

# Agent Instructions: 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:

```
GET https://junkeh.gitbook.io/eb/features/mechanics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
