How to affect an enemy after hitting it with a weapon?

Started by WhoAteMyCheerios on

Topic category: Help with modding (Java Edition)

Last seen on 21:20, 10. Aug 2020
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to affect an enemy after hitting it with a weapon?

Hi,

I've been trying to make a weapon that puts an effect on an enemy when it is hit with said weapon. I've tried a few different things but nothing has worked out in my favor. I'm relatively new to the whole procedure shenaniganry so I'm sorry if I'm missing something obvious. 

Last seen on 16:05, 13. May 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's pretty easy; You need…
Mon, 08/10/2020 - 22:45

It's pretty easy; You need to connect a procedure to it, and that procedure should be the "entity attacked" trigger. How I usually do it for this sort of thing is go into the "template library" and grab the "Add potion if entity has specific item in hand" template. You can put that under the trigger block, and finally choose your potion effect (You can make custom ones too ;). 

If you wish, you can grab the other potion block from the entity procedure tab that includes whether you can see potion particles and whether it's ambient.

 -Happy modding ;)

Last seen on 02:52, 28. Nov 2023
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried that but it isn't…
Mon, 06/06/2022 - 04:07

I tried that but it isn't working for some reason, when I hit the enemy nothing happens. If you have a solution can you please reply.

Last seen on 10:22, 10. Jul 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Jasperagoose how about that…
Mon, 06/06/2022 - 14:09

@Jasperagoose how about that one:.