13 lines
528 B
Markdown
13 lines
528 B
Markdown
# IScriptEntity.isEntityInRadius
|
|
|
|
[← IScriptEntity](index.md) · [← Master](../../wiki.md)
|
|
|
|
isEntityInRadius(IScriptEntity entity, double radius)
|
|
|
|
boolean Check if an entity is in a radius of another specific entity // Kills all cows within 5 blocks of the player function main(c) { var tracker =
|
|
|
|
|
|
|
|
c.getSubject(); var trackedEntities = c.getServer().getEntities("@e[type=cow]"); for each (var trackedEntity in trackedEntities) { if
|
|
(trackedEntity.isEntityInRadius(tracker, 5)) { trackedEntity.kill(); } } }
|