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

Started by not giggycreeper on

Topic category: Help with Minecraft modding (Java Edition)

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?

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.

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?