function init(hero, radius, tickHandler) {
    var DANGER = ["Spider", "CaveSpider", "Zombie", "WitherSkeleton", "Arrow",
         "Fireball", "SmallFireball", "PrimedTnt", "WitherSkull", "DragonFireball", "ZombieVillager",
          "MinecartTNT", "Creeper", "Skeleton", "Slime", "Ghast", "Enderman", "Silverfish", "Blaze",
           "LavaSlime", "EnderDragon", "WitherBoss", "Witch", "fiskheroes.Creetle", "fiskheroes.Cactus",
            "fiskheroes.IllusionDrone", "fiskheroes.IronMan", "fiskheroes.Grenade"];
    var listArray;

    hero.setTickHandler((entity, manager) => {
        if (PackLoader.getSide() === "CLIENT") {
            listArray = [];
                DANGER.some(mob => {entity.world().getEntitiesInRangeOf(entity.pos(), radius).forEach(other => {
                    var isArrow = other.getEntityName() == "Arrow" || String(other.getEntityName()).startsWith("fiskheroes.fiskheroes:arrow");
                    if (!other.equals(entity) && (other.getWornChestplate().suitType().indexOf("venom") === -1) && (other.getEntityName() == mob || other.is("PLAYER") || isArrow)) {
                        if((isArrow && isArrowDangerous(entity, other)) || !isArrow) {
                            listArray.push("true");
                            if (!entity.getData("skarlet:dyn/spider_sense")) {
                                entity.playSound("skarlet:spider.sense", 1, 1.15 - Math.random() * 0.3);
                            }
                            manager.setDataWithNotify(entity, "skarlet:dyn/spider_sense", true);
                        }
                    } else {
                        listArray.push("false");
                    }
                });
            });

            if (!listArray.some(entry => entry === "true")) {
                manager.setDataWithNotify(entity, "skarlet:dyn/spider_sense", false);
            }
            if (typeof tickHandler !== "undefined") {
                tickHandler(entity, manager);
            }
        }
    });
}

function isArrowDangerous(entity, arrow) {
    var arrowPos = arrow.pos();
    var entityEye = entity.eyePos();

    var targetDirection = entityEye.subtract(arrowPos).normalized();
    var dotProduct = Math.max(-1, Math.min(1, arrow.motion().normalized().dot(targetDirection)));
    var angle = Math.acos(dotProduct) * (180 / Math.PI);

    return Math.abs(angle) < 30;
}