Skip to content

Commit 27ca21b

Browse files
authored
Add aliases for closest to nearest entity expression (#8226)
1 parent 9e9ce15 commit 27ca21b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public class ExprNearestEntity extends SimpleExpression<Entity> {
3737

3838
static {
3939
Skript.registerExpression(ExprNearestEntity.class, Entity.class, ExpressionType.COMBINED,
40-
"[the] nearest %*entitydatas% [[relative] to %entity/location%]",
41-
"[the] %*entitydatas% nearest [to %entity/location%]");
40+
"[the] (nearest|closest) %*entitydatas% [[relative] to %entity/location%]",
41+
"[the] %*entitydatas% (nearest|closest) [to %entity/location%]");
4242
}
4343

4444
@SuppressWarnings("NotNullFieldNotInitialized")

src/test/skript/tests/syntaxes/expressions/ExprNearestEntity.sk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
test "nearest entity does not allow duplicate entities":
22
assert nearest cow and cow relative to {_null} to fail with "duplicate entities were allowed in nearest entity expr"
3+
assert closest cow and cow relative to {_null} to fail with "duplicate entities were allowed in nearest entity expr"
34

45
# server doesn't spawn the entities until the next tick, and we can't wait in the test system so... commented for now
56
#test "nearest entity":

0 commit comments

Comments
 (0)