Nearest Entity (Expression) — SkBee

Addon: SkBee · Category: Expression · Since: 2.7.2

Syntax

[%number%] nearest %entitydata% [in radius %-number%] (at|of|around) %location/entity% [excluding %-entities%]

Description

Returns the nearest entity around a location/entity. Requires PaperMC.

NOTE: When using `around entity`, this will exclude that entity in the search.

NOTE: When radius is excluded, the distance will default to Skript's `maximum target block distance`.

Examples

kill nearest player in radius 10 around player
damage nearest mob in radius 5 around player
set {_near} to nearest entity in radius 50 around {_loc}
set {_near} to nearest entity in radius 100 around location(100,100,100,world "world")
teleport player to nearest player in radius 10 around player
damage 10 nearest entity in radius 10 around player by 2
set {_p} to nearest player around player excluding (all player's where [input doesn't have permission "some.perm"])

View source