How Do I Make Vanilla Mobs Attack My Modded Mob?

Started by MamaLuigi on

Topic category: Help with modding (Java Edition)

Last seen on 22:37, 26. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I Make Vanilla Mobs Attack My Modded Mob?
Tue, 09/26/2023 - 15:50 (edited)

For example, if I have a mob in my mod that is a Mouse, and I want it to be attacked by the vanilla Cats and Ocelots already in minecraft, then how would I do this?

 

I have seen some methods that use code snippets, but those don't seem to work.

 

If anyone could give me a working solution, or a working version of the code snippet, then that would be great!

Edited by MamaLuigi on Tue, 09/26/2023 - 15:50
Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not entirely sure, but…
Wed, 09/27/2023 - 15:29

I'm not entirely sure, but if the entity has hostile behaviors towards something, you should be able to use the 'Set Attack Target of (event/target entity)' function. It's a recent addition in the latest version of MCreator, and I've only ever used it with modded entities and hostile/neutral vanilla entities, (like iron golems), but I assume it should also work for your purposes.