How does one make vanilla mobs attack your modded one?

Started by FlyingCatOfLol on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Jul 2021
Points:
521

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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. 

Active 2 years ago
Joined Jun 2021
Points:
541

User statistics:

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

I would also like an answer to this

Active 3 years ago
Joined Oct 2021
Points:
479

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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

Active 1 year ago
Joined May 2021
Points:
530

User statistics:

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

but where do i put it

 

Active 5 months ago
Joined Mar 2020
Points:
634

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 19
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));                                      ^
      ^
Active 1 year ago
Joined Jun 2023
Points:
272

User statistics:

  • Modifications: 1
  • Forum topics: 16
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 60
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

 

Active 1 week ago
Joined Sep 2021
Points:
930

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
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)?

Active 1 week ago
Joined Sep 2021
Points:
930

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
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));