Skip to content

Commit 9934f33

Browse files
authored
Tweak the pattern and description of ExprTarget (#7944)
fix pattern, update description, add ray size to since
1 parent a7fa49c commit 9934f33

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/main/java/ch/njol/skript/expressions/ExprTarget.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
package ch.njol.skript.expressions;
22

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-
193
import ch.njol.skript.Skript;
204
import ch.njol.skript.SkriptConfig;
215
import ch.njol.skript.classes.Changer.ChangeMode;
@@ -32,12 +16,29 @@
3216
import ch.njol.skript.registrations.EventValues;
3317
import ch.njol.util.Kleenean;
3418
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;
3533

3634
@Name("Target")
3735
@Description({
3836
"For players this is the entity at the crosshair.",
3937
"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.",
4142
"May grab entities in unloaded chunks."
4243
})
4344
@Examples({
@@ -49,13 +50,13 @@
4950
"delete targeted entity of player # for players it will delete the target",
5051
"delete target of last spawned zombie # for entities it will make them target-less"
5152
})
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)")
5354
public class ExprTarget extends PropertyExpression<LivingEntity, Entity> {
5455

5556
static {
5657
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%]"
5960
);
6061
}
6162

0 commit comments

Comments
 (0)