diff --git a/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java b/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java index 3f5db26c97a..e2cc6631ad3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java @@ -37,8 +37,8 @@ public class ExprNearestEntity extends SimpleExpression { static { Skript.registerExpression(ExprNearestEntity.class, Entity.class, ExpressionType.COMBINED, - "[the] nearest %*entitydatas% [[relative] to %entity/location%]", - "[the] %*entitydatas% nearest [to %entity/location%]"); + "[the] (nearest|closest) %*entitydatas% [[relative] to %entity/location%]", + "[the] %*entitydatas% (nearest|closest) [to %entity/location%]"); } @SuppressWarnings("NotNullFieldNotInitialized") diff --git a/src/test/skript/tests/syntaxes/expressions/ExprNearestEntity.sk b/src/test/skript/tests/syntaxes/expressions/ExprNearestEntity.sk index 843dcf7a8ae..857621ff993 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprNearestEntity.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprNearestEntity.sk @@ -1,5 +1,6 @@ test "nearest entity does not allow duplicate entities": assert nearest cow and cow relative to {_null} to fail with "duplicate entities were allowed in nearest entity expr" + assert closest cow and cow relative to {_null} to fail with "duplicate entities were allowed in nearest entity expr" # server doesn't spawn the entities until the next tick, and we can't wait in the test system so... commented for now #test "nearest entity":