# Conditions

Condition can be inside a list, for example:

```yaml
...:
    - Type: HAS_PERMISSION
      Permission: example.test
```

another example:

```yaml
Conditions:
    - Type: HAS_PERMISSION
      Permission: example.test
    - Type: HAS_PERMISSION
      Permission: test.example
```

or, it can be a section, for example:

```yaml
Type: HAS_PERMISSION
Permission: example.test
```

## Condition Types

### HAS\_PERMISSION

This checks whether theentity has the required permission

```yaml
Type: HAS_PERMISSION
Permission: <permission>
Negate: <true/false>
```

{% hint style="info" %}
If negate is true, then it will pass if the entity does NOT have the permission instead
{% endhint %}

### IS\_HOLDING

This checks whether the entity is holding an item

```yaml
Type: IS_HOLDING
Item: <item>
Negate: <true/false>
```

{% hint style="info" %}
To create an item, please see&#x20;

<https://www.spigotmc.org/wiki/itemstack-serialization/>
{% endhint %}

### IS\_ITEM\_IN\_HAND\_ENCHANTED

This checks whether the item held by the entity is enchanted

```yaml
Type: IS_ITEM_IN_HAND_ENCHANTED
Enchantment: <enchantment type>
Level: <minimum leve required to pass>
Negate: <true/false>
```

{% hint style="info" %}
For list of enchantment types, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html>
{% endhint %}

### WORLD\_WHITELIST

This checks whether the entity is inside the whitelisted world

```yaml
Type: WORLD_WHITELIST
World List: 
- list
- of
- worlds
Negate: <true/false>
```

### HAS\_ITEM

This checks whether the entity has the item inside the inventory

```yaml
Type: HAS_ITEM
Item: <item>
Negate: <true/false>
```

### HAS\_EFFECT

This checks whether the entity has the potion effect or not

```yaml
Type: HAS_EFFECT
Effect: <potion effect type>
Negate: <true/false>
```

{% hint style="info" %}
For list of potion effect types, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html>
{% endhint %}

### TYPE\_FILTER

This checks whether the entity type is allowed or not

```yaml
Type: TYPE_FILTER
Filter: <filter>
Negate: <true/false>
```

#### Filter Types

* CREATURE\
  This allows every creature

{% hint style="info" %}
To see the creature specification, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Creature.html>
{% endhint %}

* TAMED\
  This allows every tamed animals

{% hint style="info" %}
To see the tameable specification, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Tameable.html>
{% endhint %}

* ANIMALS\
  This allows every animals&#x20;

{% hint style="info" %}
To see animals specification, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Animals.html>
{% endhint %}

* MONSTER\
  This allows every monster

{% hint style="info" %}
To see monsters specification, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Monster.html>
{% endhint %}

* \<ENTITY TYPE>\
  This allows specific type to be filtered

{% hint style="info" %}
For entity types list, please see

<https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html>
{% endhint %}

You can combine more than 1 entity filter using boolean logic, for example, if you want to combine effects and those effects required to be passed, you can use "and" or "&&" or "&", for example:

```yaml
Filter: ANIMALS AND ZOMBIE aNd TAMED and PLAYER
Filter: MONSTER && PLAYER
Filter: PLAYER & WOLF & VILLAGER
```

if you want to combine effects and only need one filter to pass, you can use "or" or "||" or "|", for example:

```yaml
Filter: ANIMALS OR ZOMBIE Or TAMED or PLAYER
Filter: MONSTER || PLAYER || WITHER
Filter: PLAYER | WOLF | WITHER | VILLAGER
```

if you want to combine effects and only one filter can pass, you can use "xor" or "^", for example:

```yaml
Filter: ANIMALS XOR ZOMBIE xOr TAMED xor PLAYER
Filter: ANIMALS ^ PLAYER ^ WITHER
```

You can also combine more than 1 boolean logic and group them with parenthesis, for example:

```yaml
Filter: PLAYER OR (ANIMALS AND TAMED) XOR VILLAGER
```

### POWER\_REQUIREMENT

This checks whether the beacon pass the power requirement

```yaml
Type: POWER_REQUIREMENT
Minimum: [minimum power, optional]
Maximum: [maximum power, optional]
Negate: <true/false>
```

### FREE\_POWER\_REQUIREMENT

This checks whether the beacon pass the power requirement remaining

```yaml
Type: FREE_POWER_REQUIREMENT
Minimum: [minimum free power, optional]
Maximum: [maximum free power, optional]
Negate: <true/false>
```

### AND\_LOGIC

Combines two or more conditions, needs all condition to be valid/pass

```yaml
Type: AND_LOGIC
Conditions: <list of conditions>
```

Example:

```yaml
Type: AND_LOGIC
Conditions:
- Type: HAS_PERMISSION
  Permission: server.admin
- Type: TYPE_FILTER
  Filter: PLAYER
```

### OR\_LOGIC

Combines two or more conditions, only need one condition to be valid/pass

```yaml
Type: OR_LOGIC
Conditions:
- Type: HAS_PERMISSION
  Permission: server.admin
- Type: HAS_PERMISSION
  Permission: server.vip
```

### PLOTSQUARED\_IS\_IN\_PLOT

Checks whether the beacon is inside a plot

```yaml
Type: PLOTSQUARED_IS_IN_PLOT
Negate: <true/false>
```

{% hint style="warning" %}
Requires PlotSquared
{% endhint %}

### PLOTSQUARED\_IS\_SAME\_PLOT

Checks whether the beacon and the target entity is in the same plot

```yaml
Type: PLOTSQUARED_IS_SAME_PLOT
Negate: <true/false>
```

{% hint style="warning" %}
Requires PlotSquared
{% endhint %}

### PLOTSQUARED\_IS\_IN\_PLOT\_AREA

Checks whether the beacon is in a plot area

```yaml
Type: PLOTSQUARED_IS_IN_PLOT_AREA
Negate: <true/false>
```

{% hint style="warning" %}
Requires PlotSquared
{% endhint %}

### PLOTSQUARED\_IS\_SAME\_PLOT\_AREA

Checks whether the beacon and the target entity is in the same plot area

```yaml
Type: PLOTSQUARED_IS_SAME_PLOT_AREA
Negate: <true/false>
```

{% hint style="warning" %}
Requires PlotSquared
{% endhint %}

### GRIEFPREVENTION\_SAME\_CLAIM

Checks whether the beacon and the target entity is in the same claim area

```yaml
Type: GRIEFPREVENTION_SAME_CLAIM
Negate: <true/false>
```

{% hint style="warning" %}
Requires GriefPrevention
{% endhint %}

### GRIEFPREVENTION\_PERMISSION

Checks whether the player has GriefPrevention claim permission

```yaml
Type: GRIEFPREVENTION_PERMISSION
Permission: <Edit/Build/Inventory/Access/Manage>
Negate: <true/false>
```

{% hint style="warning" %}
Requires GriefPrevention
{% endhint %}

### GRIEFPREVENTION\_OWNER

Checks whether the player is the land/claim owner

```yaml
Type: GRIEFPREVENTION_OPWNER
Negate: <true/false>
```

{% hint style="warning" %}
Requires GriefPrevention
{% endhint %}

### GRIEFPREVENTION\_CLAIMED

Checks whether the beacon is in claimed land

```yaml
Type: GRIEFPREVENTION_CLAIMED
Negate: <true/false>
```

{% hint style="warning" %}
Requires GriefPrevention
{% endhint %}

### FACTIONS\_IN\_FACTION

Checks whether the beacon is inside faction land

```yaml
Type: FACTIONS_IN_FACTION
Negate: <true/false>
Faction: [faction name, optional]
Faction Id: [faction id, optional]
```

{% hint style="warning" %}
Requires either Factions, FactionsX, FactionsBlue, KingdomsX, Kingdoms, LegacyFactions, MedievalFactions, UltimateFactions, Towny, or Improved Factions
{% endhint %}

### FACTIONS\_IN\_SAME\_FACTION

Checks whether the beacon and the target entity is in the same faction land

```yaml
Type: FACTIONS_IN_SAME_FACTION
Negate: <true/false>
```

{% hint style="warning" %}
Requires either Factions, FactionsX, FactionsBlue, KingdomsX, Kingdoms, LegacyFactions, MedievalFactions, UltimateFactions, Towny, or Improved Factions
{% endhint %}

### FACTIONS\_IS\_ROLE

Checks the target entity role inside a faction

```yaml
Type: FACTIONS_IS_ROLE
Role: <role>
Compare To Current Location Faction: <true|false>
```

{% hint style="info" %}
If `Compare To Current Location Faction` is `true` then it will compare if the role belongs to the faction at the entity location
{% endhint %}

{% hint style="warning" %}
Requires either Factions, FactionsX, FactionsBlue, KingdomsX, Kingdoms, LegacyFactions, MedievalFactions, UltimateFactions, Towny, or Improved Factions
{% endhint %}

### TOTAL\_ACTIVE\_BEACON\_EFFECTS

Checks how many active beacon effects on a beacon

```yaml
Type: TOTAL_ACTIVE_BEACON_EFFECTS
Minimum: [optional]
Maximum: [optional]
```

If the minimum is specified and the total is less than the minimum, it will not pass the check

If the maximum is specified and the total is greater than the maximum, it will not pass the check

{% hint style="warning" %}
If you use this condition on the effect config, players still can upgrade and activate more than the minimum and maximum range specified in the config, but when the total is outside of the range, it will deactivate the effect.
{% endhint %}

### NESTING CONDITION

You can combine AND LOGIC and OR LOGIC, for example:

```yaml
Type: OR_LOGIC
Conditions:
- Type: HAS_PERMISSION
  Permission: server.admin
- Type: AND_LOGIC
  Conditions:
  - Type: HAS_PERMISSION
    Permission: server.vip
  - Type: HAS_PERMISSION
    Permission: server.mvp
  - Type: OR_LOGIC
    Conditions:
    - Type: HAS_PERMISSION
      Permission: server.test
    - Type: HAS_PERMISSION
      Permission: test.server
```


---

# 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://septogeddondev.gitbook.io/beaconplus/configuration/conditions.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.
