I want to run this code every ten ticks but I don't know what XYZ.abc(e => .... I put it in, also I don't know how to detect if the player is within a range of blocks from any entity of a specific tag. This is for a boss fight I'm making with kubejs because it's easier to understand JS than it is to understand and manipulate commands.
PlayerEvents.tick(event => {
const player = event.player;
const level = player.level;
if (!level.isClientSide) {
// how to detect if the player is within 5 blocks of any mob with the tag of "zombie_boss" or "skeleton_boss" or "spider_boss"
if (detected) {
player.hurt('minecraft:generic', 2);
}
}
});