Check if player attacks entity with a weapon

Started by Mopru on

Topic category: Help with Minecraft modding (Java Edition)

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.

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