How to make something happen to a mob that hits a player?

Started by DancatGamer on

Topic category: Help with modding (Java Edition)

Last seen on 13:26, 1. Jun 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make something happen to a mob that hits a player?

How to make something happen to a mob that hits a player?

Last seen on 04:26, 1. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You want to use the global…
Wed, 01/24/2024 - 15:19

You want to use the global trigger 'before entity hurt.' Then use an if bracket to check if the event/target entity, (the one being hurt), is your custom entity, and the source entity, (the one attacking), is a subtype of 'player.' You should be able to find everything you need in the logic and flow-control tabs.

Last seen on 13:26, 1. Jun 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If anything, I'm on versions…
Wed, 01/24/2024 - 15:34

If anything, I'm on versions 2023.2

Last seen on 04:26, 1. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...These functions should be…
Wed, 01/24/2024 - 17:00

...These functions should be available in that version? I'm not sure I understand.