|
1 | 1 | package ch.njol.skript.expressions;
|
2 | 2 |
|
3 |
| -import java.util.function.Predicate; |
4 |
| - |
5 |
| -import org.bukkit.GameMode; |
6 |
| -import org.bukkit.Location; |
7 |
| -import org.bukkit.OfflinePlayer; |
8 |
| -import org.bukkit.entity.Entity; |
9 |
| -import org.bukkit.entity.LivingEntity; |
10 |
| -import org.bukkit.entity.Mob; |
11 |
| -import org.bukkit.entity.Player; |
12 |
| -import org.bukkit.event.Event; |
13 |
| -import org.bukkit.event.entity.EntityTargetEvent; |
14 |
| -import org.bukkit.util.RayTraceResult; |
15 |
| -import org.bukkit.util.Vector; |
16 |
| -import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; |
17 |
| -import org.jetbrains.annotations.Nullable; |
18 |
| - |
19 | 3 | import ch.njol.skript.Skript;
|
20 | 4 | import ch.njol.skript.SkriptConfig;
|
21 | 5 | import ch.njol.skript.classes.Changer.ChangeMode;
|
|
32 | 16 | import ch.njol.skript.registrations.EventValues;
|
33 | 17 | import ch.njol.util.Kleenean;
|
34 | 18 | import ch.njol.util.coll.CollectionUtils;
|
| 19 | +import org.bukkit.GameMode; |
| 20 | +import org.bukkit.Location; |
| 21 | +import org.bukkit.OfflinePlayer; |
| 22 | +import org.bukkit.entity.Entity; |
| 23 | +import org.bukkit.entity.LivingEntity; |
| 24 | +import org.bukkit.entity.Mob; |
| 25 | +import org.bukkit.entity.Player; |
| 26 | +import org.bukkit.event.Event; |
| 27 | +import org.bukkit.event.entity.EntityTargetEvent; |
| 28 | +import org.bukkit.util.RayTraceResult; |
| 29 | +import org.bukkit.util.Vector; |
| 30 | +import org.jetbrains.annotations.Nullable; |
| 31 | + |
| 32 | +import java.util.function.Predicate; |
35 | 33 |
|
36 | 34 | @Name("Target")
|
37 | 35 | @Description({
|
38 | 36 | "For players this is the entity at the crosshair.",
|
39 | 37 | "For mobs and experience orbs this is the entity they are attacking/following (if any).",
|
40 |
| - "Display entities have a hit box of 0, so you should use 'target display' to collect Display entities", |
| 38 | + "The 'ray size' and 'ignoring blocks' options are only valid for players' targets.", |
| 39 | + "The 'ray size' option effectively increases the area around the crosshair an entity can be in. It does so " + |
| 40 | + "by expanding the hitboxes of entities by the given amount. Display entities have a hit box of 0, " + |
| 41 | + "so using the 'ray size' option can be helpful when targeting them.", |
41 | 42 | "May grab entities in unloaded chunks."
|
42 | 43 | })
|
43 | 44 | @Examples({
|
|
49 | 50 | "delete targeted entity of player # for players it will delete the target",
|
50 | 51 | "delete target of last spawned zombie # for entities it will make them target-less"
|
51 | 52 | })
|
52 |
| -@Since("1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks)") |
| 53 | +@Since("1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks, ray size)") |
53 | 54 | public class ExprTarget extends PropertyExpression<LivingEntity, Entity> {
|
54 | 55 |
|
55 | 56 | static {
|
56 | 57 | Skript.registerExpression(ExprTarget.class, Entity.class, ExpressionType.PROPERTY,
|
57 |
| - "[the] target[[ed] %-*entitydata%] [of %livingentities%] [blocks:ignoring blocks] [[with|at] ray[ ]size %-number%]", // TODO add a where filter when extendable https://github.com/SkriptLang/Skript/issues/4856 |
58 |
| - "%livingentities%'[s] target[[ed] %-*entitydata%] [blocks:ignoring blocks] [[with|at] ray[ ]size %-number%]" |
| 58 | + "[the] target[[ed] %-*entitydata%] [of %livingentities%] [blocks:ignoring blocks] [[with|at] [a] ray[ ]size [of] %-number%]", // TODO add a filter section |
| 59 | + "%livingentities%'[s] target[[ed] %-*entitydata%] [blocks:ignoring blocks] [[with|at] [a] ray[ ]size [of] %-number%]" |
59 | 60 | );
|
60 | 61 | }
|
61 | 62 |
|
|
0 commit comments