Run command when player attacking.

Started by lmacu on

Topic category: Help with MCreator software

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Run command when player attacking.

Like title, can i make a procedure, and run command when player deal damage on mob?

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global trigger: Entity is…
Fri, 05/23/2025 - 11:09

Procedure

Global trigger: Entity is attacked

if (is [source entity] (sub)type of (Player))

execute command "/say attacked!!!"

 

sourceentity is the player and entity is the attacked entity

I tested this and it worked