Skript
Skript copied to clipboard
Add ExprNearestEntity
Description
Adds an expression to get the nearest entity relative to another entity or location. Example script:
on click:
broadcast nearest mob
kill nearest mob
Target Minecraft Versions: Any Requirements: None Related Issues: #4674
You don't need the entity type in the pattern along with location, converters will take care of that
You don't need the entity type in the pattern along with location, converters will take care of that
it's there on purpose because otherwise if you do, for example, nearest player relative to player the result will be player. Taking in an entity specifically allows me to exclude that entity from the search. See the below code snippets (in particular line 84)
https://github.com/SkriptLang/Skript/blob/6e28d9448f5b6fb1d364f4fd0a9db4df058c684e/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java#L79-L93
https://github.com/SkriptLang/Skript/blob/6e28d9448f5b6fb1d364f4fd0a9db4df058c684e/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java#L104
Ah okay, that makes sense, I hadn't seen that part of the method initially
When you apply changes, you can re-request a review from the user that asked for the changes when they're completed. That way the pull request gets looked into more, and eventually merged faster. Like me, I sort by "Awaiting reviews from you" first when starting reviews.