How to make a mob use held weapon procedures?

Started by Pez on Sun, 07/26/2020 - 22:43

Topic category: Help with modding (Java Edition)

Last seen on 00:46, 21. Sep 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make a mob use held weapon procedures?
Sun, 07/26/2020 - 22:43

The issue I'm having is that one of my mobs holds a sword I have programmed to strike lightning whenever it hits something. I can't seem to find a way to make this happen when the mob is holding the weapon, only when the player is. I've also tried adding procedures that say to summon lightning when the mob attacks something, but there doesn't seem to be an event for mob attacking, only for mob being attacked. Any suggestions on how to get this working?

Last seen on 12:39, 13. Jun 2021
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
There is an event.  "When…
Mon, 07/27/2020 - 14:53

There is an event. 

"When entity attacked" in the procedure triggers.

Last seen on 00:46, 21. Sep 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
That event is for when the…
Sun, 08/02/2020 - 22:46

That event is for when the entity I'm creating is attacked, right? That's my problem. I'm not trying to make something happen when that entity is attacked, I'm trying to make something happen when that entity attacks something else.