I need help making a enchantment that strikes lightning on mobs when you hit them.

Started by GLuxes09 on

Topic category: Help with modding (Java Edition)

Last seen on 01:27, 1. Sep 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need help making a enchantment that strikes lightning on mobs when you hit them.

I'm trying to make a enchantment where when you hit a mob, it will strike lightning on them and I need help,

Last seen on 19:10, 27. Dec 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could run a procedure…
Sat, 06/05/2021 - 21:56

you could run a procedure with the global trigger "before entity is hurt" or "entity attacked", and check if the source entity has an item with the enchantment in their main hand, then if it does use the "strike lightning at..." procedure block and replace the x,y,z of the lightning strike with "x position of event/target entity", "y position of event/target entity" and "z position of event/target entity". Or something along those lines