Entity that when is strucked by a lighting, it throws a lighting to every near entity except of you, then it dissapear

Started by Antonyan000 on

Topic category: Help with modding (Java Edition)

Last seen on 10:08, 10. Apr 2024
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity that when is strucked by a lighting, it throws a lighting to every near entity except of you, then it dissapear

I'm working on a ranged item that when throws the projectile, it spawns an entity which I would like to give the features that I've mentioned in the title.

My idea is basically that the player can kill the entity by the normal way, with a sword, bow, or any weapon, but if it dies from a lighting, it ''reflects'' the lightning to the other mobs

except of you (player).

Last seen on 13:54, 28. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a procedure that…
Wed, 04/10/2024 - 04:16

Make a procedure that triggers when the entity dies, that runs an entity iterator bracket. (This is found in the world tab, and essentially targets every entity in a radius.) Inside the bracket, use an if-bracket to check if the entity iterator is a living entity, and is not a subtype of player. Inside the if bracket, use the 'strike lightning' function to summon lightning at the x/y/z position of the entity iterator. (Again, this will run for every entity in the radius that meets the conditions you provide.)