# Plugin Events

## CITIZENS RIGHT CLICK NPC

{% hint style="warning" %}
Requires Citizens: <https://www.spigotmc.org/resources/citizens.13811/>
{% endhint %}

Event called when a player right clicks on a Citizens NPC.

```yaml
example:
  type: citizens_right_click_npc
  conditions:
  - '%npc_id% == 50'
  actions:
    default:
    - "player_command: rtp"
```

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

* <mark style="color:green;">%npc\_id%</mark> (ID of the clicked NPC)
* <mark style="color:green;">%npc\_name%</mark> (Name of the clicked NPC)
  {% endhint %}

## WGEVENTS REGION ENTER

{% hint style="warning" %}
Requires WorldGuard Events: <https://www.spigotmc.org/resources/worldguard-events.65176/>
{% endhint %}

Event called when a player enters a WorldGuard region.

```yaml
example:
  type: wgevents_region_enter
  conditions:
  - '%region% == main_city'
  actions:
    default:
    - "title: 20;40;20;&6&lENTERING AREA;&7City of Kryngel"
```

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

* <mark style="color:green;">%region%</mark> (Entered region)
  {% endhint %}

{% hint style="warning" %}
This event can't be cancelled with **cancel\_event** action.
{% endhint %}

## WGEVENTS REGION LEAVE

{% hint style="warning" %}
Requires WorldGuard Events: <https://www.spigotmc.org/resources/worldguard-events.65176/>
{% endhint %}

Event called when a player leaves a WorldGuard region.

```yaml
example:
  type: wgevents_region_leave
  conditions:
  - '%region% == main_city'
  actions:
    default:
    - "title: 20;40;20;&6&lLEAVING AREA;&7City of Kryngel"
```

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

* <mark style="color:green;">%region%</mark> (Leaved region)
  {% endhint %}

{% hint style="warning" %}
This event can't be cancelled with **cancel\_event** action.
{% endhint %}

## PROTOCOLLIB RECEIVE MESSAGE

{% hint style="warning" %}
Requires ProtocolLib: <https://www.spigotmc.org/resources/protocollib.1997/>
{% endhint %}

Event called when a player receives a chat message.

```yaml
example:
  type: protocollib_receive_message
  conditions:
  - "%normal_message% contains &cWelcome to the server."
  actions:
    default:
    - "cancel_event: true"
```

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

* <mark style="color:green;">%normal\_message%</mark> (Message received including color codes)
* <mark style="color:green;">%normal\_message\_without\_color\_codes%</mark> (Message received without color codes)
* <mark style="color:green;">%json\_message%</mark> (Complete JSON format of the message received)
  {% endhint %}


---

# 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://ajneb97.gitbook.io/conditionalevents/event-types/plugin-events.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.
