Many years ago our youngest Daughter around 2 YO would aggravate our then cat while he slept. In turn he would hide in doorways and jump out and scare the bejeebers out of her. After I caught on to what was going on I told her if she left him alone he wouldn't bother her. Finally she did and he stopped scaring her.
Paybacks are not always fun.