I'm working on a script to modify boss rifts when they're spawned from a specific boss, particularly bosses of mass destruction ones. The first step is figuring out what boss spawned the rift, and I thought the best way to test that would to check for the closest entity, since the boss rifts are spawned directly on the entity when they die. Right now I've got this
EntityEvents.spawned('bossrifts:boss_rift', event => {
const rift = event.entity
const entitiesNear = rift.level.getNearbyEntities(rift,rift.distanceToEntitySqr() < 100)
console.log("Nearby: "+entitiesNear)
})
the part I'm struggling with is I know the code const entitiesNear = rift.level.getNearbyEntities(rift,rift.distanceToEntitySqr() < 100) is incorrect, but I don't know what the correct method would be. I just don't know every function and how to use it, even with probejs.