How does one make vanilla mobs attack your modded one?

Started by FlyingCatOfLol on

Topic category: Help with Minecraft modding (Java Edition)

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. 

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

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

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));                                      ^
      ^
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

 

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)?

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));