How do I make a custom mob immune to a custom ranged weapon?

Started by not giggycreeper on

Topic category: Help with modding (Java Edition)

Last seen on 19:49, 27. Jan 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a custom mob immune to a custom ranged weapon?

Hello! I am in progress of making a mod with ranged mobs. I need help with on how to make a ranged item not damage these mobs. Any ideas?

Last seen on 00:07, 8. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Set the ranged item's damage…
Sat, 11/12/2022 - 13:28

Set the ranged item's damage to zero, and then create a procedure for when hit to deal damage if the target entity is not one of the mobs you want to be immune. Note that they might still take knockback, unless you make the ranged item not deal knockback to anything.

Last seen on 19:49, 27. Jan 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I set the entity that…
Sun, 02/19/2023 - 19:17

How do I set the entity that I do not want immune?