check if entity hit another

Started by Lord Makishi on Sat, 09/24/2022 - 18:14

Topic category: Help with modding (Java Edition)

Last seen on 19:30, 26. Oct 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
check if entity hit another
Sat, 09/24/2022 - 18:14

Hi, i want to check if an custom made entity hit another entity. If yes, the source entity gains an temporary regeneration effect (basically like Lifesteal). I've tried many procedures, but with no success.

Last seen on 14:29, 21. Nov 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can use global trigger…
Sat, 09/24/2022 - 19:23

You can use global trigger Entity Attacked. It provides which entity and by who was attacked.

Then in if block you can try checking if source entity is a (sub) type of your mob -> there's block named something like "is entity (sub) type of".

Last seen on 19:30, 26. Oct 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks, for helping me again…
Sat, 09/24/2022 - 19:29

Thanks, for helping me again, this was the only block i was missing!