How does one make vanilla mobs attack your modded one?

Started by FlyingCatOfLol on

Topic category: Help with modding (Java Edition)

Last seen on 23:48, 6. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How does one make vanilla mobs attack your modded one?

I have a Villager which will attack illagers, but how do i make illagers attack it, illagers as in vanilla mobs like pillagers and vindicators. 

Last seen on 00:18, 14. Mar 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would also like an answer…
Sat, 07/17/2021 - 16:37

I would also like an answer to this

Last seen on 12:45, 27. Nov 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
months later but try this …
Mon, 11/08/2021 - 02:59

months later but try this 

https://imgur.com/jzAffOd 

used this code 
((MobEntity)entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((MobEntity)entity, JakethedogEntity.CustomEntity.class, false, false));

 

replace the "JakethedogEntity" with your entity public class name. for some reason this doesn't work for indicators when I was testing it, I'm not sure why

Last seen on 13:21, 2. Mar 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but where do i put it  
Fri, 01/14/2022 - 10:04

but where do i put it

 

Last seen on 18:52, 13. Jan 2024
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i followed minotheboy's…
Tue, 08/08/2023 - 15:52

i followed minotheboy's tutorial but it gives me some errors

ill only put the important parts here
but it seems like it doesnt know what MobEntity and CustomEntity mean

error: cannot find symbol
((MobEntity) entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((MobEntity) entity, GlungusEntity.CustomEntity.class, false, false));                                      ^
      ^
Last seen on 16:20, 16. Nov 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you explain each part…
Sat, 09/09/2023 - 20:05

Can you explain each part like entity public class name, because my dumb brain doesn't know how to use it

 

Last seen on 18:19, 28. Mar 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Say i have an entity in my…
Tue, 09/26/2023 - 15:37

Say i have an entity in my mod called "Mouse", and i want it to be attacked by vanilla Cats, then would i replace "JakethedogEntity" with "MouseEntity", and ((MobEntity)entity) with ((CatEntity)entity)?

Last seen on 18:19, 28. Mar 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
would that change the code…
Tue, 09/26/2023 - 15:44

would that change the code to ((CatEntity)entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((CatEntity)entity, MouseEntity.CustomEntity.class, false, false));