how to make custom hostile entity friendly to its species/to a specific entity type

Started by carnivowrist on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to make custom hostile entity friendly to its species/to a specific entity type

hello i'm trying to make an entity hostile to every entity type except its own kind, i've been looking for solutions but i never managed to fix this. Ive tried making the entity spawn with an item in its slot and make it so it checks before targeting if the entity has this item so then they wouldn't attack, but it doesn't work and they would still sometimes attack eachothers, if someone has a solution please describe me step by step or just very clearly as i don't know very well how to use this program (like custom code), thanks