How to make a mob vulnerable to only one kind of weapon.

Started by thxlotl on

Topic category: Help with modding (Java Edition)

Last seen on 02:17, 12. Jun 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob vulnerable to only one kind of weapon.

I'm making a crab mob for my mod and I was thinking of making it only be able to take direct damage through getting hit by a wooden shovel (because it looks like a mallet)

Last seen on 20:39, 27. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i dont know if its possable…
Wed, 05/26/2021 - 00:16

i dont know if its possable but you could make it take no damage overall then add a procedure checking if the player attacked it

and had "wooden shovel" in mainhand then deal damage but i dont think this would work with sharpness if for some reason you had that on the shovel

Last seen on 02:17, 12. Jun 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks I'll try that!
Wed, 05/26/2021 - 01:44

Thanks I'll try that!

Last seen on 20:39, 27. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if ya run into more issues…
Wed, 05/26/2021 - 14:49

if ya run into more issues you can post a screenshot of the procedure and i can check it out

Last seen on 11:11, 27. Nov 2022
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a procedure "On…
Wed, 05/26/2021 - 15:57

Create a procedure "On entity attacked" and check if the attacked entity is a Crab, and if yes check if the item in main-hand of the attacking entity is a Wooden Shovel. If not, cancel event that triggered global trigger.

Last seen on 11:11, 27. Nov 2022
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It'll work with Sharpness…
Wed, 05/26/2021 - 16:11

It'll work with Sharpness and other damage changing effects such as Strentgh.

Last seen on 02:17, 12. Jun 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
awesome thanks!
Fri, 06/04/2021 - 01:42

awesome thanks!