Make a Mob that can only be hurt by specific Weapon

Started by Finmide on Sun, 01/10/2021 - 20:49

Topic category: Help with modding (Java Edition)

Last seen on 22:36, 10. Jan 2021
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make a Mob that can only be hurt by specific Weapon
Sun, 01/10/2021 - 20:49

For a mod I am making a Vampire mob. But I want to make it so they can only be killed by a wooden tool of some kind.

Last seen on 16:00, 25. Feb 2021
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So, first, make the mob…
Tue, 01/26/2021 - 07:24

So, first, make the mob immune to all kinds of attacks.

Then make procedure with the entity attacked trigger and check if event/target entity is vampire. Check if item in item in main hand of source entity is frxmpl wooden sword, and if it is, deal x damage to event/target entity. It must be repeated for each wooden tool, but I hope it should work. I don't know any other way.

P.S. Sorry for my English if I have mistakes.