Closed normalUserKarn closed 5 months ago
Can be done like this:
int id = game.entities.findClosestEntityById("minecraft:player");
// or
// int id = game.entities.findClosestEntityByClass("net.minecraft.world.entity.monster.Monster");
if (id > 0) {
float x = game.entities.getX(id);
// ...
}
Add a way to get the coordinates of entities or the closest entity of a specific type around you as a float or integer.