
# -> Set attributes
attribute @s fall_damage_multiplier base set 0.25
attribute @s scale base set 0.4
attribute @s max_health modifier add overly_realistic:spider_nerf_max_health -0.65 add_multiplied_total
attribute @s attack_damage modifier add overly_realistic:spider_nerf_attack_damage -0.5 add_multiplied_total

# -> If spider is below Y=1, on RNG, set as cave spider
execute unless entity @s[type=spider,y=1,dy=-9999] run \
    return fail
execute unless predicate overly_realistic:mobs/spider_become_cave_spider_rng run \
    return fail

# -> Spawn cave spider
execute summon cave_spider run \
    function overly_realistic:animals/operations/spiders/spider_spawn

# -> Remove entity
tp ~ ~-9999 ~
kill @s