Check if player attacks entity with a weapon

Started by Mopru on

Topic category: Help with modding (Java Edition)

Last seen on 21:51, 28. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if player attacks entity with a weapon

How can I make a global trigger that checks if an entity is attacked by a weapon.

Last seen on 20:18, 12. Mar 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global trigger: "Beforeā€¦
Wed, 06/28/2023 - 18:05

Global trigger: "Before entity is hurt"

If (Item in main hand of (Source entity) is the same as (Your weapon))

Then do whatever you want with the Event/target entity