Nearest Entity (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.7

Syntax

[the] (nearest|closest) %*entitydatas% [[relative] to %entity/location%]

Description

Gets the entity nearest to a location or another entity.

Examples

kill the nearest pig and cow relative to player
teleport player to the nearest cow relative to player
teleport player to the nearest entity relative to player
on click:
	kill nearest pig

View source