Applying Potion Effect to Target Entity when Hit

Started by quinmn on Sun, 06/06/2021 - 18:05

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:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Applying Potion Effect to Target Entity when Hit
Sun, 06/06/2021 - 18:05

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 12:54, 25. Jul 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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)"