Skip to content

Commit

Permalink
victim_conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanthiax committed Apr 14, 2024
1 parent 87da835 commit e908326
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/effects/all-conditions/has_pet.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `has_pet
# `has_pet`

Requires a player to have a certain pet

Expand Down
12 changes: 12 additions & 0 deletions docs/effects/all-filters/victim_conditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# `victim_conditions`

Check conditions against the victim

# Example Config
```yaml
filters:
victim_conditions: # List of conditions to check
- id: above_health_percent
args:
percent: 50
```
26 changes: 26 additions & 0 deletions docs/effects/configuring-a-condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,29 @@ effects:
```

So here, MVP players would get $100 for breaking a block, whereas non-MVP players would be told to buy the rank to get the perk when they try to break a block. This functions as an alternative to not-met-lines.
## Victim Conditions

You can also check if the victim (player/entity) meets the conditions before running the effects by using the `victim_conditions` filter, [here](plugins.auxilor.io/effects/all-filters/victim_conditions). You can combine these with usual conditions to create intricate effects with comprehensive lists of criteria to be met.

In config, they look like this:

```yaml
effects:
- id: give_money
args:
amount: 100
filters:
victim_conditions:
- id: in_mainhand
args:
items:
- DIAMOND_SWORD
conditions:
- id: below_y
args:
y: 0
triggers:
- melee_attack
```

So here, the player will gain $100 when they attack a player/entity wielding a diamond sword in their main-hand, whilst the player is below Y level 0.

0 comments on commit e908326

Please sign in to comment.