How do i make an entity ignore a player when i'm holding an item in hand?

Started by NebuliteStudios on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i make an entity ignore a player when i'm holding an item in hand?
Thu, 03/21/2024 - 16:08 (edited)

Hello everybody,
I have a hostile entity that attacks a player, but i want it so whenever i'm holding a certain item in hand, the entity ignores the player.
Is there any way to achieve this?

Edited by NebuliteStudios on Thu, 03/21/2024 - 16:08
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you talking about a…
Fri, 03/22/2024 - 15:42

Are you talking about a custom mob of your own make? or an 'Monster' Mob anyone else adds to MC? 

If it's your own then you just add a condition procedure to the AI Attack procedures; in order to check it the targeted player has your trigger item in their main or offhand. 

If its the vanilla mobs or those made by others... I'd be interested to know too.

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Figured it out, and to…
Mon, 03/25/2024 - 19:02

Figured it out, and to answer your question, it was a custom mob!