distance
Whether the distance between the caster and target is within the given range
Configuration Fields (1)
| Name | Type | Default | Description |
|---|---|---|---|
| distance d | RangedDouble | — | The distance to match |
Examples & Notes
Examples
TargetConditions:
- distance{d=<2}
This example will spawn an armor stand with debug rings to show distance. Depending on the player’s distance from the armor stand, the mob will send a different message
distance_mob:
Type: ARMOR_STAND
Skills:
- particlering{p=redstone;points=20;r=3;a=1} @self ~onTimer:20
- particlering{p=redstone;points=20;r=7;color=#00ff48;a=1} @self ~onTimer:20
- particlering{p=redstone;points=20;r=10;color=#0059ff;a=1} @self ~onTimer:20
- skill{s=distance_check} @PIR{r=10;limit=1;sort=NEAREST} ~onTimer:20
distance_check:
TargetConditions:
- distance{d=0to3} castinstead distance_check_close
- distance{d=3to7} castinstead distance_check_mid
- distance{d=>7} castinstead distance_check_far
Skills:
- message{m="This message is never sent"}
distance_check_close:
Skills:
- message{m="<red><target.name> is close to the caster!"}
distance_check_mid:
Skills:
- message{m="<green><target.name> is medium distance from the caster!"}
distance_check_far:
Skills:
- message{m="<blue><target.name> is far from the caster!"}
This example was kindly provided by slipperysmurf
Universal Condition Options
Mentioned by
Tests if the caster is within a certain distance of a location.
Tests if the caster is within a certain distance of a pin.
Whether the distance from the world's spawn point to the target is within the given range
Tests if the caster is within a certain distance of its tracked location.
Tests if the origin is within a certain distance of a pin.
Tests if the target's target is not within a certain distance
Tests if the target's target is within a certain distance
Targets players that are within render distance of the caster
- Author:
- Ashijin
