Targets
Targets are the entities or blocks that will be affected by an ability. Examples of targets include the player using the ability, the victim of an attack, or a block that has been broken.
Here are some examples of targets:
@Victim
: Applies the effect to the victim of an event (such as an attack).@Attacker
: Applies the effect to the attacker of an event (such as an attack).@Block
: Applies the effect to the block that was interacted with (such as right-clicking).@NearestPlayer{radius=0}
: Applies the effect to the nearest player within the specified radius.
You can use multiple targets in a single effect, separated by a comma. For example:
@Victim, @Attacker
would apply the effect to both the victim and the attacker of an event.Targets can be configured with additional options. For example, you can use the
radius
option to specify the radius around a target to search for another target.Here's an example of a target configuration using the
radius
option:effects:
- 'MESSAGE:you are the nearest player! @NearestPlayer{radius=10}'
This would apply the effect to the nearest player within a radius of 10 blocks.
Here is a table of all available targets, along with their descriptions:
Name | Description |
---|---|
@Victim | Applies the effect to the victim of an event (such as an attack). |
@Attacker | Applies the effect to the attacker of an event (such as an attack). |
@Block | Applies the effect to the block that was interacted with (such as right-clicking). |
@NearestPlayer{radius=0} | Applies the effect to the nearest player within the specified radius. |
@EyeHeight | Applies the effect at entity's eye location |
@Trench{radius=x} | Applies effect in square (e.g. 3x3x3) size area (commonly used for Trench) |
@BlockInDistance{distance=1} | Gets block within distance (closest one or the furthest away location if no block is within distance) |
Last modified 2d ago