how add effect if player is damaged by cactus or fall damage or entity?

Started by emb3rcia on

Topic category: Help with MCreator software

Last seen on 04:00, 19. Jan 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how add effect if player is damaged by cactus or fall damage or entity?

I want to have 1 in 5 chance of adding 1 tier of my custom effect "Wounded" indefinitely to the player every time he is damaged by cactus/fall damage/entity/arrow or firework/explosion, so for example he will get wounded 1 first time, then wounded 2 second time etc.

I also want to give some mobs (like husks or ravagers) better chance at implying the effect.

I have 2 problems. 1: I can't find a function to see if damage is from some source, 2: I don't know how to see if it's from a specific mob like husk or zombie. How I can do this?