Applying Potion Effect to Target Entity when Hit

Started by quinmn on

Topic category: Help with modding (Java Edition)

Last seen on 13:24, 19. Jun 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Applying Potion Effect to Target Entity when Hit

Hi, just some coding issues at the moment. I am trying to make a wither crown item that allows the player to apply wither effect to entities when the player hits something (fire aspect for wither effect). So far I have:

 

          When (entity attacked):

If:   Has (event/target entity) in inventory (wither crown)

do:  Add potion with level (1) for (100) ticks ambient (true/false [tried both]) particles (true) to (event/target entity) type (wither)

 

Whenever I attack a zombie, for example, neither the player or the zombie gets the wither effect. Any help or clarification would be really helpful. Kinda new to this so if the solution is obvious, that's why.

Last seen on 18:29, 16. Mar 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello. Try to replace it …
Mon, 06/07/2021 - 08:22

Hello.

Try to replace it "event/target entity" to this "sourse entity" at this point: "If:   Has (event/target entity) in inventory (wither crown)"