How to make a mob use held weapon procedures?

Started by Pez on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob use held weapon procedures?

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?

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.