
# -> Set attributes
attribute @s max_health modifier add overly_realistic:animal_tired_from_fleeing -0.2 add_multiplied_total
attribute @s movement_speed modifier add overly_realistic:animal_tired_from_fleeing -0.75 add_multiplied_total

# -> Remove jump step height attribute
attribute @s step_height modifier remove overly_realistic:animal_panic_step_height

# -> Set exhaustion value
execute store result score @s OverlyRealistic.Animal.Exhaustion run \
    random value 2..5

# -> Sound
execute if entity @s[type=pig] run \
    return run \
        playsound minecraft:entity.pig.ambient neutral @a ~ ~ ~ 1 0.7
execute if entity @s[type=cow] run \
    return run \
        playsound minecraft:entity.cow.ambient neutral @a ~ ~ ~ 1 0.7
execute if entity @s[type=sheep] run \
    return run \
        playsound minecraft:entity.sheep.hurt neutral @a ~ ~ ~ 1 0.8
execute if entity @s[type=chicken] run \
    return run \
        playsound minecraft:entity.chicken.hurt neutral @a ~ ~ ~ 1 0.8
execute if entity @s[type=horse] run \
    return run \
        playsound minecraft:entity.horse.angry neutral @a ~ ~ ~ 1 0.85
