Used command:
execute as @e[type=minecraft:<entity_type>] at @s on target run tellraw @s [{"selector":"@e[sort=nearest,limit=1]"}," found you!"]
(Repeating)This command will send text if certain type of hostile entity detects player as a target.
But this only doesn't work for Breeze
I can confirm this. Relates to MC-264456 and MC-263315.