Topic category: Help with Minecraft modding (Java Edition)
Put Event Trigger to Entity Attacked
if - is "Source Entity" (sub)type of "PUT YOUR CUSTOM ENTITY HERE"
do = Add potion "Effect" with level "your level of potion effect level" for "Tick(s)" ticks ambient "false" particles "false" to Event/target entity
(example) https://kappa.lol/IfKu3 if you want to see the picture of how i made it, will be easier to look at :)
if you have any question i might be able to help you
Also make sure any trigger in your Living Entity to all be default, no extra procedures.
https://kappa.lol/1gorQ (pictures here of your living entity properties, you can add or remove stuff here if you want but keep it all blank if you just want standard Entity/Mob give "Effect(s)" when hitting Player or Entity vice versa.
I made this because there is currently almost no tutorial for it.